aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@gmail.com>2017-04-03 15:50:15 -0400
committerWladimir J. van der Laan <laanwj@gmail.com>2017-04-05 08:37:12 +0200
commitea060c7495b10394ecf6909bc0327e93a2a34a7f (patch)
tree0124bf14698d35bad8fe39729c1337b984fe4243
parentd947afc0f7868815dff248ad398c3680def5bf81 (diff)
downloadbitcoin-ea060c7495b10394ecf6909bc0327e93a2a34a7f.tar.xz
Bugfix: ancestor modifed fees were incorrect for descendants
If prioritisetransaction was called for a tx with in-mempool descendants, the modified ancestor fee values for those descendants was incorrect. Github-Pull: #10144 Rebased-From: 9bef02e36525d0eed4e2e31678b3ff04bbb0b8cb
-rw-r--r--src/txmempool.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index 5842dd88d8..91040fb9b2 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -938,6 +938,13 @@ void CTxMemPool::PrioritiseTransaction(const uint256 hash, const std::string str
BOOST_FOREACH(txiter ancestorIt, setAncestors) {
mapTx.modify(ancestorIt, update_descendant_state(0, nFeeDelta, 0));
}
+ // Now update all descendants' modified fees with ancestors
+ setEntries setDescendants;
+ CalculateDescendants(it, setDescendants);
+ setDescendants.erase(it);
+ BOOST_FOREACH(txiter descendantIt, setDescendants) {
+ mapTx.modify(descendantIt, update_ancestor_state(0, nFeeDelta, 0, 0));
+ }
}
}
LogPrintf("PrioritiseTransaction: %s priority += %f, fee += %d\n", strHash, dPriorityDelta, FormatMoney(nFeeDelta));