MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / PrioritiseTransaction

Method PrioritiseTransaction

src/txmempool.cpp:829–857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

827}
828
829void CTxMemPool::PrioritiseTransaction(const uint256& hash, const CAmount& nFeeDelta)
830{
831 {
832 LOCK(cs);
833 CAmount &delta = mapDeltas[hash];
834 delta += nFeeDelta;
835 txiter it = mapTx.find(hash);
836 if (it != mapTx.end()) {
837 mapTx.modify(it, update_fee_delta(delta));
838 // Now update all ancestors' modified fees with descendants
839 setEntries setAncestors;
840 uint64_t nNoLimit = std::numeric_limits<uint64_t>::max();
841 std::string dummy;
842 CalculateMemPoolAncestors(*it, setAncestors, nNoLimit, nNoLimit, nNoLimit, nNoLimit, dummy, false);
843 for (txiter ancestorIt : setAncestors) {
844 mapTx.modify(ancestorIt, update_descendant_state(0, nFeeDelta, 0));
845 }
846 // Now update all descendants' modified fees with ancestors
847 setEntries setDescendants;
848 CalculateDescendants(it, setDescendants);
849 setDescendants.erase(it);
850 for (txiter descendantIt : setDescendants) {
851 mapTx.modify(descendantIt, update_ancestor_state(0, nFeeDelta, 0, 0));
852 }
853 ++nTransactionsUpdated;
854 }
855 }
856 LogPrintf("PrioritiseTransaction: %s feerate += %s\n", hash.ToString(), FormatMoney(nFeeDelta));
857}
858
859void CTxMemPool::ApplyDelta(const uint256 hash, CAmount &nFeeDelta) const
860{

Callers 2

LoadMempoolFunction · 0.80
prioritisetransactionFunction · 0.80

Calls 9

update_fee_deltaClass · 0.85
maxFunction · 0.85
FormatMoneyFunction · 0.85
findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected