Skip to content

Commit

Permalink
Update txmempool.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
koh-gt authored Apr 25, 2024
1 parent 5b535a6 commit b7a3677
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/txmempool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,16 +818,11 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const

bool CTxMemPool::CompareDepthAndScore(const uint256& hasha, const uint256& hashb, bool wtxid)
{
/* Return `true` if hasha should be considered sooner than hashb. Namely when:
* a is not in the mempool, but b is
* both are in the mempool and a has fewer ancestors than b
* both are in the mempool and a has a higher score than b
*/
LOCK(cs);
indexed_transaction_set::const_iterator j = wtxid ? get_iter_from_wtxid(hashb) : mapTx.find(hashb);
if (j == mapTx.end()) return false;
indexed_transaction_set::const_iterator i = wtxid ? get_iter_from_wtxid(hasha) : mapTx.find(hasha);
if (i == mapTx.end()) return true;
if (i == mapTx.end()) return false;
indexed_transaction_set::const_iterator j = wtxid ? get_iter_from_wtxid(hashb) : mapTx.find(hashb);
if (j == mapTx.end()) return true;
uint64_t counta = i->GetCountWithAncestors();
uint64_t countb = j->GetCountWithAncestors();
if (counta == countb) {
Expand Down

0 comments on commit b7a3677

Please sign in to comment.