| 628 | } |
| 629 | |
| 630 | void 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 | |
| 657 | void CTxMemPool::ApplyDelta(const Txid& hash, CAmount &nFeeDelta) const |
| 658 | { |