Changeset View
Changeset View
Standalone View
Standalone View
src/policy/fees.cpp
Show First 20 Lines • Show All 374 Lines • ▼ Show 20 Lines | void CBlockPolicyEstimator::processTransaction(const CTxMemPoolEntry &entry, | ||||
// 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. | ||||
if (!validFeeEstimate) { | if (!validFeeEstimate) { | ||||
untrackedTxs++; | untrackedTxs++; | ||||
return; | return; | ||||
} | } | ||||
trackedTxs++; | trackedTxs++; | ||||
// Feerates are stored and reported as BCC-per-kb: | // Feerates are stored and reported as BCH-per-kb: | ||||
CFeeRate feeRate(entry.GetFee(), entry.GetTxSize()); | CFeeRate feeRate(entry.GetFee(), entry.GetTxSize()); | ||||
mapMemPoolTxs[txid].blockHeight = txHeight; | mapMemPoolTxs[txid].blockHeight = txHeight; | ||||
mapMemPoolTxs[txid].bucketIndex = | mapMemPoolTxs[txid].bucketIndex = | ||||
feeStats.NewTx(txHeight, double(feeRate.GetFeePerK().GetSatoshis())); | feeStats.NewTx(txHeight, double(feeRate.GetFeePerK().GetSatoshis())); | ||||
} | } | ||||
bool CBlockPolicyEstimator::processBlockTx(unsigned int nBlockHeight, | bool CBlockPolicyEstimator::processBlockTx(unsigned int nBlockHeight, | ||||
Show All 11 Lines | if (blocksToConfirm <= 0) { | ||||
// This can't happen because we don't process transactions from a block | // This can't happen because we don't process transactions from a block | ||||
// with a height lower than our greatest seen height | // with a height lower than our greatest seen height | ||||
LogPrint( | LogPrint( | ||||
"estimatefee", | "estimatefee", | ||||
"Blockpolicy error Transaction had negative blocksToConfirm\n"); | "Blockpolicy error Transaction had negative blocksToConfirm\n"); | ||||
return false; | return false; | ||||
} | } | ||||
// Feerates are stored and reported as BCC-per-kb: | // Feerates are stored and reported as BCH-per-kb: | ||||
CFeeRate feeRate(entry->GetFee(), entry->GetTxSize()); | CFeeRate feeRate(entry->GetFee(), entry->GetTxSize()); | ||||
feeStats.Record(blocksToConfirm, | feeStats.Record(blocksToConfirm, | ||||
(double)feeRate.GetFeePerK().GetSatoshis()); | (double)feeRate.GetFeePerK().GetSatoshis()); | ||||
return true; | return true; | ||||
} | } | ||||
void CBlockPolicyEstimator::processBlock( | void CBlockPolicyEstimator::processBlock( | ||||
▲ Show 20 Lines • Show All 161 Lines • Show Last 20 Lines |