diff options
author | glozow <gloriajzhao@gmail.com> | 2021-10-20 16:41:45 +0100 |
---|---|---|
committer | glozow <gloriajzhao@gmail.com> | 2021-10-21 16:26:59 +0100 |
commit | 4307849256761fe2440d82bbec892d0e8e6b4dd4 (patch) | |
tree | 7d32e7727d87b15b4b45a98a446b357a5072570d /src/txmempool.cpp | |
parent | d50fbd4c5b4bc72415854d582cedf94541a46983 (diff) | |
download | bitcoin-4307849256761fe2440d82bbec892d0e8e6b4dd4.tar.xz |
[mempool] delete exists(uint256) function
Allowing callers to pass in a uint256 (which could be txid or wtxid)
but then always assuming that it's a txid is a footgunny interface.
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r-- | src/txmempool.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 5a93f30c8a..b945659c0d 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -969,7 +969,7 @@ CTxMemPool::setEntries CTxMemPool::GetIterSet(const std::set<uint256>& hashes) c bool CTxMemPool::HasNoInputsOf(const CTransaction &tx) const { for (unsigned int i = 0; i < tx.vin.size(); i++) - if (exists(tx.vin[i].prevout.hash)) + if (exists(GenTxid::Txid(tx.vin[i].prevout.hash))) return false; return true; } @@ -1140,7 +1140,7 @@ void CTxMemPool::TrimToSize(size_t sizelimit, std::vector<COutPoint>* pvNoSpends if (pvNoSpendsRemaining) { for (const CTransaction& tx : txn) { for (const CTxIn& txin : tx.vin) { - if (exists(txin.prevout.hash)) continue; + if (exists(GenTxid::Txid(txin.prevout.hash))) continue; pvNoSpendsRemaining->push_back(txin.prevout); } } |