diff options
author | ismaelsadeeq <ask4ismailsadiq@gmail.com> | 2023-11-03 13:23:30 +0100 |
---|---|---|
committer | ismaelsadeeq <ask4ismailsadiq@gmail.com> | 2023-11-22 11:48:21 +0100 |
commit | 91532bd38223d7d04166e05de11d0d0b55e60f13 (patch) | |
tree | 8446e39a5ab8d24f00bef53762302dc675b85f44 /src/policy/fees.cpp | |
parent | bfcd401368fc0dc43827a8969a37b7e038d5ca79 (diff) | |
download | bitcoin-91532bd38223d7d04166e05de11d0d0b55e60f13.tar.xz |
tx fees, policy: update `CBlockPolicyEstimator::processBlock` parameter
Update `processBlock` parameter to reference to a vector of `RemovedMempoolTransactionInfo`.
Diffstat (limited to 'src/policy/fees.cpp')
-rw-r--r-- | src/policy/fees.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp index df5885b059..6d550b1d5a 100644 --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -618,10 +618,10 @@ void CBlockPolicyEstimator::processTransaction(const CTxMemPoolEntry& entry, boo assert(bucketIndex == bucketIndex3); } -bool CBlockPolicyEstimator::processBlockTx(unsigned int nBlockHeight, const CTxMemPoolEntry* entry) +bool CBlockPolicyEstimator::processBlockTx(unsigned int nBlockHeight, const RemovedMempoolTransactionInfo& tx) { AssertLockHeld(m_cs_fee_estimator); - if (!_removeTx(entry->GetTx().GetHash(), true)) { + if (!_removeTx(tx.info.m_tx->GetHash(), true)) { // This transaction wasn't being tracked for fee estimation return false; } @@ -629,7 +629,7 @@ bool CBlockPolicyEstimator::processBlockTx(unsigned int nBlockHeight, const CTxM // How many blocks did it take for miners to include this transaction? // blocksToConfirm is 1-based, so a transaction included in the earliest // possible block has confirmation count of 1 - int blocksToConfirm = nBlockHeight - entry->GetHeight(); + int blocksToConfirm = nBlockHeight - tx.info.txHeight; if (blocksToConfirm <= 0) { // This can't happen because we don't process transactions from a block with a height // lower than our greatest seen height @@ -638,7 +638,7 @@ bool CBlockPolicyEstimator::processBlockTx(unsigned int nBlockHeight, const CTxM } // Feerates are stored and reported as BTC-per-kb: - CFeeRate feeRate(entry->GetFee(), entry->GetTxSize()); + CFeeRate feeRate(tx.info.m_fee, tx.info.m_virtual_transaction_size); feeStats->Record(blocksToConfirm, static_cast<double>(feeRate.GetFeePerK())); shortStats->Record(blocksToConfirm, static_cast<double>(feeRate.GetFeePerK())); @@ -646,8 +646,8 @@ bool CBlockPolicyEstimator::processBlockTx(unsigned int nBlockHeight, const CTxM return true; } -void CBlockPolicyEstimator::processBlock(unsigned int nBlockHeight, - std::vector<const CTxMemPoolEntry*>& entries) +void CBlockPolicyEstimator::processBlock(const std::vector<RemovedMempoolTransactionInfo>& txs_removed_for_block, + unsigned int nBlockHeight) { LOCK(m_cs_fee_estimator); if (nBlockHeight <= nBestSeenHeight) { @@ -676,8 +676,8 @@ void CBlockPolicyEstimator::processBlock(unsigned int nBlockHeight, unsigned int countedTxs = 0; // Update averages with data points from current block - for (const auto& entry : entries) { - if (processBlockTx(nBlockHeight, entry)) + for (const auto& tx : txs_removed_for_block) { + if (processBlockTx(nBlockHeight, tx)) countedTxs++; } @@ -688,7 +688,7 @@ void CBlockPolicyEstimator::processBlock(unsigned int nBlockHeight, LogPrint(BCLog::ESTIMATEFEE, "Blockpolicy estimates updated by %u of %u block txs, since last block %u of %u tracked, mempool map size %u, max target %u from %s\n", - countedTxs, entries.size(), trackedTxs, trackedTxs + untrackedTxs, mapMemPoolTxs.size(), + countedTxs, txs_removed_for_block.size(), trackedTxs, trackedTxs + untrackedTxs, mapMemPoolTxs.size(), MaxUsableEstimate(), HistoricalBlockSpan() > BlockSpan() ? "historical" : "current"); trackedTxs = 0; |