v30.3-roots.1 · Commit 51: [PATCH 51/68] mempool: synchronize dynamic dust fee publication
src/validation.cpp
Before: src/validation.cpp · After: src/validation.cpp
File metadata
index 41c00262a30b6d8c629c87c4e24386fb5b473d8e..912f9d02f2e3287855160beb40c47cfc16bb3e46 100644
Download original patch · Release notes
Diff rows 1–32 of 32. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/validation.cpp
CHANGED
|
@@ -1110,7 +1110,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
|
|
| 1110 |
if (m_pool.m_opts.subdustfeepenalty) {
|
| 1111 |
CAmount dust_penalty{0};
|
| 1112 |
for (const auto& txout : tx.vout) {
|
| 1113 |
-
const CAmount dust_threshold = GetDustThreshold(txout, m_pool.m_opts.dust_relay_feerate);
|
| 1114 |
if (txout.nValue < dust_threshold) {
|
| 1115 |
dust_penalty = SaturatingAdd(dust_penalty, dust_threshold - txout.nValue);
|
| 1116 |
}
|
|
@@ -1125,7 +1125,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
|
|
| 1125 |
|
| 1126 |
// Enforces 0-fee for dust transactions, no incentive to be mined alone
|
| 1127 |
if (m_pool.m_opts.require_standard && !ignore_rejects.count("dust")) {
|
| 1128 |
-
if (!PreCheckEphemeralTx(*ptx, m_pool.m_opts.dust_relay_feerate, ws.m_base_fees, ws.m_modified_fees, state)) {
|
| 1129 |
return false; // state filled in by PreCheckEphemeralTx
|
| 1130 |
}
|
| 1131 |
}
|
|
@@ -1745,7 +1745,7 @@ MempoolAcceptResult MemPoolAccept::AcceptSingleTransaction(const CTransactionRef
|
|
| 1745 |
|
| 1746 |
if (m_pool.m_opts.require_standard) {
|
| 1747 |
Wtxid dummy_wtxid;
|
| 1748 |
-
if (!CheckEphemeralSpends(/*package=*/{ptx}, m_pool.m_opts.dust_relay_feerate, m_pool, ws.m_state, dummy_wtxid)) {
|
| 1749 |
return MempoolAcceptResult::Failure(ws.m_state);
|
| 1750 |
}
|
| 1751 |
}
|
|
@@ -1906,7 +1906,7 @@ PackageMempoolAcceptResult MemPoolAccept::AcceptMultipleTransactions(const std::
|
|
| 1906 |
if (m_pool.m_opts.require_standard && !(args.m_ignore_rejects.count("dust") || args.m_ignore_rejects.count("unspent-dust") || args.m_ignore_rejects.count("missing-ephemeral-spends"))) {
|
| 1907 |
TxValidationState child_state;
|
| 1908 |
Wtxid child_wtxid;
|
| 1909 |
-
if (!CheckEphemeralSpends(txns, m_pool.m_opts.dust_relay_feerate, m_pool, child_state, child_wtxid)) {
|
| 1910 |
package_state.Invalid(PackageValidationResult::PCKG_TX, "unspent-dust");
|
| 1911 |
results.emplace(child_wtxid, MempoolAcceptResult::Failure(child_state));
|
| 1912 |
return PackageMempoolAcceptResult(package_state, std::move(results));
|
|
|
|
| 1110 |
if (m_pool.m_opts.subdustfeepenalty) {
|
| 1111 |
CAmount dust_penalty{0};
|
| 1112 |
for (const auto& txout : tx.vout) {
|
| 1113 |
+
const CAmount dust_threshold = GetDustThreshold(txout, m_pool.GetDustRelayFee());
|
| 1114 |
if (txout.nValue < dust_threshold) {
|
| 1115 |
dust_penalty = SaturatingAdd(dust_penalty, dust_threshold - txout.nValue);
|
| 1116 |
}
|
|
|
|
| 1125 |
|
| 1126 |
// Enforces 0-fee for dust transactions, no incentive to be mined alone
|
| 1127 |
if (m_pool.m_opts.require_standard && !ignore_rejects.count("dust")) {
|
| 1128 |
+
if (!PreCheckEphemeralTx(*ptx, m_pool.GetDustRelayFee(), ws.m_base_fees, ws.m_modified_fees, state)) {
|
| 1129 |
return false; // state filled in by PreCheckEphemeralTx
|
| 1130 |
}
|
| 1131 |
}
|
|
|
|
| 1745 |
|
| 1746 |
if (m_pool.m_opts.require_standard) {
|
| 1747 |
Wtxid dummy_wtxid;
|
| 1748 |
+
if (!CheckEphemeralSpends(/*package=*/{ptx}, m_pool.GetDustRelayFee(), m_pool, ws.m_state, dummy_wtxid)) {
|
| 1749 |
return MempoolAcceptResult::Failure(ws.m_state);
|
| 1750 |
}
|
| 1751 |
}
|
|
|
|
| 1906 |
if (m_pool.m_opts.require_standard && !(args.m_ignore_rejects.count("dust") || args.m_ignore_rejects.count("unspent-dust") || args.m_ignore_rejects.count("missing-ephemeral-spends"))) {
|
| 1907 |
TxValidationState child_state;
|
| 1908 |
Wtxid child_wtxid;
|
| 1909 |
+
if (!CheckEphemeralSpends(txns, m_pool.GetDustRelayFee(), m_pool, child_state, child_wtxid)) {
|
| 1910 |
package_state.Invalid(PackageValidationResult::PCKG_TX, "unspent-dust");
|
| 1911 |
results.emplace(child_wtxid, MempoolAcceptResult::Failure(child_state));
|
| 1912 |
return PackageMempoolAcceptResult(package_state, std::move(results));
|