Skip to content

Commit 5615e16

Browse files
committed
tx fees: update m_from_disconnected_block to m_mempool_limit_bypassed
The boolean indicates whether the transaction was added without enforcing mempool fee limits. m_mempool_limit_bypassed is the correct variable name. Also changes NewMempoolTransactionInfo booleans descriptions to the format that is consistent with the codebase.
1 parent fcd4296 commit 5615e16

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

src/kernel/mempool_entry.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ struct NewMempoolTransactionInfo {
226226
* This boolean indicates whether the transaction was added
227227
* without enforcing mempool fee limits.
228228
*/
229-
const bool m_from_disconnected_block;
229+
const bool m_mempool_limit_bypassed;
230230
/* This boolean indicates whether the transaction is part of a package. */
231231
const bool m_submitted_in_package;
232232
/*
@@ -239,11 +239,11 @@ struct NewMempoolTransactionInfo {
239239

240240
explicit NewMempoolTransactionInfo(const CTransactionRef& tx, const CAmount& fee,
241241
const int64_t vsize, const unsigned int height,
242-
const bool from_disconnected_block, const bool submitted_in_package,
242+
const bool mempool_limit_bypassed, const bool submitted_in_package,
243243
const bool chainstate_is_current,
244244
const bool has_no_mempool_parents)
245245
: info{tx, fee, vsize, height},
246-
m_from_disconnected_block{from_disconnected_block},
246+
m_mempool_limit_bypassed{mempool_limit_bypassed},
247247
m_submitted_in_package{submitted_in_package},
248248
m_chainstate_is_current{chainstate_is_current},
249249
m_has_no_mempool_parents{has_no_mempool_parents} {}

src/policy/fees.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ void CBlockPolicyEstimator::processTransaction(const NewMempoolTransactionInfo&
612612
// - the node is not behind
613613
// - the transaction is not dependent on any other transactions in the mempool
614614
// - it's not part of a package.
615-
const bool validForFeeEstimation = !tx.m_from_disconnected_block && !tx.m_submitted_in_package && tx.m_chainstate_is_current && tx.m_has_no_mempool_parents;
615+
const bool validForFeeEstimation = !tx.m_mempool_limit_bypassed && !tx.m_submitted_in_package && tx.m_chainstate_is_current && tx.m_has_no_mempool_parents;
616616

617617
// Only want to be updating estimates when our blockchain is synced,
618618
// otherwise we'll miscalculate how many blocks its taking to get included.

src/test/fuzz/policy_estimator.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ FUZZ_TARGET(policy_estimator, .init = initialize_policy_estimator)
4747
const CTxMemPoolEntry& entry = ConsumeTxMemPoolEntry(fuzzed_data_provider, tx);
4848
const auto tx_info = NewMempoolTransactionInfo(entry.GetSharedTx(), entry.GetFee(),
4949
entry.GetTxSize(), entry.GetHeight(),
50-
/* m_from_disconnected_block */ false,
51-
/* m_submitted_in_package */ false,
52-
/* m_chainstate_is_current */ true,
53-
/* m_has_no_mempool_parents */ fuzzed_data_provider.ConsumeBool());
50+
/*mempool_limit_bypassed=*/false,
51+
/*submitted_in_package=*/false,
52+
/*chainstate_is_current=*/true,
53+
/*has_no_mempool_parents=*/fuzzed_data_provider.ConsumeBool());
5454
block_policy_estimator.processTransaction(tx_info);
5555
if (fuzzed_data_provider.ConsumeBool()) {
5656
(void)block_policy_estimator.removeTx(tx.GetHash());

src/test/policyestimator_tests.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
7070
feeV[j],
7171
virtual_size,
7272
entry.nHeight,
73-
/* m_from_disconnected_block */ false,
74-
/* m_submitted_in_package */ false,
75-
/* m_chainstate_is_current */ true,
76-
/* m_has_no_mempool_parents */ true)};
73+
/*mempool_limit_bypassed=*/false,
74+
/*submitted_in_package=*/false,
75+
/*chainstate_is_current=*/true,
76+
/*has_no_mempool_parents=*/true)};
7777
GetMainSignals().TransactionAddedToMempool(tx_info, mpool.GetAndIncrementSequence());
7878
}
7979
uint256 hash = tx.GetHash();
@@ -171,10 +171,10 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
171171
feeV[j],
172172
virtual_size,
173173
entry.nHeight,
174-
/* m_from_disconnected_block */ false,
175-
/* m_submitted_in_package */ false,
176-
/* m_chainstate_is_current */ true,
177-
/* m_has_no_mempool_parents */ true)};
174+
/*mempool_limit_bypassed=*/false,
175+
/*submitted_in_package=*/false,
176+
/*chainstate_is_current=*/true,
177+
/*has_no_mempool_parents=*/true)};
178178
GetMainSignals().TransactionAddedToMempool(tx_info, mpool.GetAndIncrementSequence());
179179
}
180180
uint256 hash = tx.GetHash();
@@ -235,10 +235,10 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
235235
feeV[j],
236236
virtual_size,
237237
entry.nHeight,
238-
/* m_from_disconnected_block */ false,
239-
/* m_submitted_in_package */ false,
240-
/* m_chainstate_is_current */ true,
241-
/* m_has_no_mempool_parents */ true)};
238+
/*mempool_limit_bypassed=*/false,
239+
/*submitted_in_package=*/false,
240+
/*chainstate_is_current=*/true,
241+
/*has_no_mempool_parents=*/true)};
242242
GetMainSignals().TransactionAddedToMempool(tx_info, mpool.GetAndIncrementSequence());
243243
}
244244
uint256 hash = tx.GetHash();

0 commit comments

Comments
 (0)