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

Method PrioritiseTransaction

src/txmempool.cpp:630–655  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

628}
629
630void CTxMemPool::PrioritiseTransaction(const Txid& hash, const CAmount& nFeeDelta)
631{
632 {
633 LOCK(cs);
634 CAmount &delta = mapDeltas[hash];
635 delta = SaturatingAdd(delta, nFeeDelta);
636 txiter it = mapTx.find(hash);
637 if (it != mapTx.end()) {
638 // PrioritiseTransaction calls stack on previous ones. Set the new
639 // transaction fee to be current modified fee + feedelta.
640 it->UpdateModifiedFee(nFeeDelta);
641 m_txgraph->SetTransactionFee(*it, it->GetModifiedFee());
642 ++nTransactionsUpdated;
643 }
644 if (delta == 0) {
645 mapDeltas.erase(hash);
646 LogInfo("PrioritiseTransaction: %s (%sin mempool) delta cleared\n", hash.ToString(), it == mapTx.end() ? "not " : "");
647 } else {
648 LogInfo("PrioritiseTransaction: %s (%sin mempool) fee += %s, new delta=%s\n",
649 hash.ToString(),
650 it == mapTx.end() ? "not " : "",
651 FormatMoney(nFeeDelta),
652 FormatMoney(delta));
653 }
654 }
655}
656
657void CTxMemPool::ApplyDelta(const Txid& hash, CAmount &nFeeDelta) const
658{

Callers 9

BOOST_AUTO_TEST_CASEFunction · 0.80
BOOST_FIXTURE_TEST_CASEFunction · 0.80
BOOST_FIXTURE_TEST_CASEFunction · 0.80
TestPrioritisedMiningMethod · 0.80
rbf.cppFile · 0.80
package_eval.cppFile · 0.80
tx_pool.cppFile · 0.80
prioritisetransactionFunction · 0.80
LoadMempoolFunction · 0.80

Calls 9

SaturatingAddFunction · 0.85
FormatMoneyFunction · 0.85
findMethod · 0.80
UpdateModifiedFeeMethod · 0.80
endMethod · 0.45
SetTransactionFeeMethod · 0.45
GetModifiedFeeMethod · 0.45
eraseMethod · 0.45
ToStringMethod · 0.45

Tested by 4

BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_FIXTURE_TEST_CASEFunction · 0.64
BOOST_FIXTURE_TEST_CASEFunction · 0.64
TestPrioritisedMiningMethod · 0.64