From 44b64b933dec10f5ffcd7f34e7bf5e4ed97f671e Mon Sep 17 00:00:00 2001 From: Alex Morcos Date: Tue, 29 Nov 2016 15:40:03 -0500 Subject: [PATCH] Fix edge case with stale fee estimates --- src/policy/fees.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp index f1c93a497..5407aefb4 100644 --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -321,9 +321,11 @@ void CBlockPolicyEstimator::processTransaction(const CTxMemPoolEntry& entry, boo return; } - if (txHeight < nBestSeenHeight) { + if (txHeight != nBestSeenHeight) { // Ignore side chains and re-orgs; assuming they are random they don't // affect the estimate. We'll potentially double count transactions in 1-block reorgs. + // Ignore txs if BlockPolicyEstimator is not in sync with chainActive.Tip(). + // It will be synced next time a block is processed. return; }