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: 9bef02e365
This commit is contained in:
Suhas Daftuar 2017-04-03 15:50:15 -04:00 committed by Wladimir J. van der Laan
parent d947afc0f7
commit ea060c7495
No known key found for this signature in database
GPG key ID: 74810B012346C9A6

View file

@ -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));