mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-29 13:32:33 +02:00
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.
This commit is contained in:
parent
fcd4296648
commit
5615e16b70
@ -226,7 +226,7 @@ struct NewMempoolTransactionInfo {
|
|||||||
* This boolean indicates whether the transaction was added
|
* This boolean indicates whether the transaction was added
|
||||||
* without enforcing mempool fee limits.
|
* without enforcing mempool fee limits.
|
||||||
*/
|
*/
|
||||||
const bool m_from_disconnected_block;
|
const bool m_mempool_limit_bypassed;
|
||||||
/* This boolean indicates whether the transaction is part of a package. */
|
/* This boolean indicates whether the transaction is part of a package. */
|
||||||
const bool m_submitted_in_package;
|
const bool m_submitted_in_package;
|
||||||
/*
|
/*
|
||||||
@ -239,11 +239,11 @@ struct NewMempoolTransactionInfo {
|
|||||||
|
|
||||||
explicit NewMempoolTransactionInfo(const CTransactionRef& tx, const CAmount& fee,
|
explicit NewMempoolTransactionInfo(const CTransactionRef& tx, const CAmount& fee,
|
||||||
const int64_t vsize, const unsigned int height,
|
const int64_t vsize, const unsigned int height,
|
||||||
const bool from_disconnected_block, const bool submitted_in_package,
|
const bool mempool_limit_bypassed, const bool submitted_in_package,
|
||||||
const bool chainstate_is_current,
|
const bool chainstate_is_current,
|
||||||
const bool has_no_mempool_parents)
|
const bool has_no_mempool_parents)
|
||||||
: info{tx, fee, vsize, height},
|
: info{tx, fee, vsize, height},
|
||||||
m_from_disconnected_block{from_disconnected_block},
|
m_mempool_limit_bypassed{mempool_limit_bypassed},
|
||||||
m_submitted_in_package{submitted_in_package},
|
m_submitted_in_package{submitted_in_package},
|
||||||
m_chainstate_is_current{chainstate_is_current},
|
m_chainstate_is_current{chainstate_is_current},
|
||||||
m_has_no_mempool_parents{has_no_mempool_parents} {}
|
m_has_no_mempool_parents{has_no_mempool_parents} {}
|
||||||
|
@ -612,7 +612,7 @@ void CBlockPolicyEstimator::processTransaction(const NewMempoolTransactionInfo&
|
|||||||
// - the node is not behind
|
// - the node is not behind
|
||||||
// - the transaction is not dependent on any other transactions in the mempool
|
// - the transaction is not dependent on any other transactions in the mempool
|
||||||
// - it's not part of a package.
|
// - it's not part of a package.
|
||||||
const bool validForFeeEstimation = !tx.m_from_disconnected_block && !tx.m_submitted_in_package && tx.m_chainstate_is_current && tx.m_has_no_mempool_parents;
|
const bool validForFeeEstimation = !tx.m_mempool_limit_bypassed && !tx.m_submitted_in_package && tx.m_chainstate_is_current && tx.m_has_no_mempool_parents;
|
||||||
|
|
||||||
// Only want to be updating estimates when our blockchain is synced,
|
// Only want to be updating estimates when our blockchain is synced,
|
||||||
// otherwise we'll miscalculate how many blocks its taking to get included.
|
// otherwise we'll miscalculate how many blocks its taking to get included.
|
||||||
|
@ -47,10 +47,10 @@ FUZZ_TARGET(policy_estimator, .init = initialize_policy_estimator)
|
|||||||
const CTxMemPoolEntry& entry = ConsumeTxMemPoolEntry(fuzzed_data_provider, tx);
|
const CTxMemPoolEntry& entry = ConsumeTxMemPoolEntry(fuzzed_data_provider, tx);
|
||||||
const auto tx_info = NewMempoolTransactionInfo(entry.GetSharedTx(), entry.GetFee(),
|
const auto tx_info = NewMempoolTransactionInfo(entry.GetSharedTx(), entry.GetFee(),
|
||||||
entry.GetTxSize(), entry.GetHeight(),
|
entry.GetTxSize(), entry.GetHeight(),
|
||||||
/* m_from_disconnected_block */ false,
|
/*mempool_limit_bypassed=*/false,
|
||||||
/* m_submitted_in_package */ false,
|
/*submitted_in_package=*/false,
|
||||||
/* m_chainstate_is_current */ true,
|
/*chainstate_is_current=*/true,
|
||||||
/* m_has_no_mempool_parents */ fuzzed_data_provider.ConsumeBool());
|
/*has_no_mempool_parents=*/fuzzed_data_provider.ConsumeBool());
|
||||||
block_policy_estimator.processTransaction(tx_info);
|
block_policy_estimator.processTransaction(tx_info);
|
||||||
if (fuzzed_data_provider.ConsumeBool()) {
|
if (fuzzed_data_provider.ConsumeBool()) {
|
||||||
(void)block_policy_estimator.removeTx(tx.GetHash());
|
(void)block_policy_estimator.removeTx(tx.GetHash());
|
||||||
|
@ -70,10 +70,10 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
|||||||
feeV[j],
|
feeV[j],
|
||||||
virtual_size,
|
virtual_size,
|
||||||
entry.nHeight,
|
entry.nHeight,
|
||||||
/* m_from_disconnected_block */ false,
|
/*mempool_limit_bypassed=*/false,
|
||||||
/* m_submitted_in_package */ false,
|
/*submitted_in_package=*/false,
|
||||||
/* m_chainstate_is_current */ true,
|
/*chainstate_is_current=*/true,
|
||||||
/* m_has_no_mempool_parents */ true)};
|
/*has_no_mempool_parents=*/true)};
|
||||||
GetMainSignals().TransactionAddedToMempool(tx_info, mpool.GetAndIncrementSequence());
|
GetMainSignals().TransactionAddedToMempool(tx_info, mpool.GetAndIncrementSequence());
|
||||||
}
|
}
|
||||||
uint256 hash = tx.GetHash();
|
uint256 hash = tx.GetHash();
|
||||||
@ -171,10 +171,10 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
|||||||
feeV[j],
|
feeV[j],
|
||||||
virtual_size,
|
virtual_size,
|
||||||
entry.nHeight,
|
entry.nHeight,
|
||||||
/* m_from_disconnected_block */ false,
|
/*mempool_limit_bypassed=*/false,
|
||||||
/* m_submitted_in_package */ false,
|
/*submitted_in_package=*/false,
|
||||||
/* m_chainstate_is_current */ true,
|
/*chainstate_is_current=*/true,
|
||||||
/* m_has_no_mempool_parents */ true)};
|
/*has_no_mempool_parents=*/true)};
|
||||||
GetMainSignals().TransactionAddedToMempool(tx_info, mpool.GetAndIncrementSequence());
|
GetMainSignals().TransactionAddedToMempool(tx_info, mpool.GetAndIncrementSequence());
|
||||||
}
|
}
|
||||||
uint256 hash = tx.GetHash();
|
uint256 hash = tx.GetHash();
|
||||||
@ -235,10 +235,10 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates)
|
|||||||
feeV[j],
|
feeV[j],
|
||||||
virtual_size,
|
virtual_size,
|
||||||
entry.nHeight,
|
entry.nHeight,
|
||||||
/* m_from_disconnected_block */ false,
|
/*mempool_limit_bypassed=*/false,
|
||||||
/* m_submitted_in_package */ false,
|
/*submitted_in_package=*/false,
|
||||||
/* m_chainstate_is_current */ true,
|
/*chainstate_is_current=*/true,
|
||||||
/* m_has_no_mempool_parents */ true)};
|
/*has_no_mempool_parents=*/true)};
|
||||||
GetMainSignals().TransactionAddedToMempool(tx_info, mpool.GetAndIncrementSequence());
|
GetMainSignals().TransactionAddedToMempool(tx_info, mpool.GetAndIncrementSequence());
|
||||||
}
|
}
|
||||||
uint256 hash = tx.GetHash();
|
uint256 hash = tx.GetHash();
|
||||||
|
Loading…
Reference in New Issue
Block a user