Skip to content

Commit 9bef02e

Browse files
committed
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.
1 parent ba7dd8b commit 9bef02e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/txmempool.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,13 @@ void CTxMemPool::PrioritiseTransaction(const uint256& hash, const CAmount& nFeeD
912912
BOOST_FOREACH(txiter ancestorIt, setAncestors) {
913913
mapTx.modify(ancestorIt, update_descendant_state(0, nFeeDelta, 0));
914914
}
915+
// Now update all descendants' modified fees with ancestors
916+
setEntries setDescendants;
917+
CalculateDescendants(it, setDescendants);
918+
setDescendants.erase(it);
919+
BOOST_FOREACH(txiter descendantIt, setDescendants) {
920+
mapTx.modify(descendantIt, update_ancestor_state(0, nFeeDelta, 0, 0));
921+
}
915922
}
916923
}
917924
LogPrintf("PrioritiseTransaction: %s feerate += %s\n", hash.ToString(), FormatMoney(nFeeDelta));

0 commit comments

Comments
 (0)