mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-22 04:38:55 +02:00
tx fees, policy: CBlockPolicyEstimator update from CValidationInterface notifications
`CBlockPolicyEstimator` will implement `CValidationInterface` and subscribe to its notification to process transactions added and removed from the mempool. Re-delegate calculation of `validForFeeEstimation` from validation to fee estimator. Also clean up the validForFeeEstimation arg thats no longer needed in `CTxMempool`. Co-authored-by: Matt Corallo <git@bluematt.me>
This commit is contained in:
@@ -44,9 +44,16 @@ FUZZ_TARGET(policy_estimator, .init = initialize_policy_estimator)
|
||||
return;
|
||||
}
|
||||
const CTransaction tx{*mtx};
|
||||
block_policy_estimator.processTransaction(ConsumeTxMemPoolEntry(fuzzed_data_provider, tx), fuzzed_data_provider.ConsumeBool());
|
||||
const CTxMemPoolEntry& entry = ConsumeTxMemPoolEntry(fuzzed_data_provider, tx);
|
||||
const auto tx_info = NewMempoolTransactionInfo(entry.GetSharedTx(), entry.GetFee(),
|
||||
entry.GetTxSize(), entry.GetHeight(),
|
||||
/* m_from_disconnected_block */ false,
|
||||
/* m_submitted_in_package */ false,
|
||||
/* m_chainstate_is_current */ true,
|
||||
/* m_has_no_mempool_parents */ fuzzed_data_provider.ConsumeBool());
|
||||
block_policy_estimator.processTransaction(tx_info);
|
||||
if (fuzzed_data_provider.ConsumeBool()) {
|
||||
(void)block_policy_estimator.removeTx(tx.GetHash(), /*inBlock=*/fuzzed_data_provider.ConsumeBool());
|
||||
(void)block_policy_estimator.removeTx(tx.GetHash());
|
||||
}
|
||||
},
|
||||
[&] {
|
||||
@@ -69,7 +76,7 @@ FUZZ_TARGET(policy_estimator, .init = initialize_policy_estimator)
|
||||
block_policy_estimator.processBlock(txs, fuzzed_data_provider.ConsumeIntegral<unsigned int>());
|
||||
},
|
||||
[&] {
|
||||
(void)block_policy_estimator.removeTx(ConsumeUInt256(fuzzed_data_provider), /*inBlock=*/fuzzed_data_provider.ConsumeBool());
|
||||
(void)block_policy_estimator.removeTx(ConsumeUInt256(fuzzed_data_provider));
|
||||
},
|
||||
[&] {
|
||||
block_policy_estimator.FlushUnconfirmed();
|
||||
|
||||
Reference in New Issue
Block a user