aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.h
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2021-10-20 16:41:45 +0100
committerglozow <gloriajzhao@gmail.com>2021-10-21 16:26:59 +0100
commit4307849256761fe2440d82bbec892d0e8e6b4dd4 (patch)
tree7d32e7727d87b15b4b45a98a446b357a5072570d /src/txmempool.h
parentd50fbd4c5b4bc72415854d582cedf94541a46983 (diff)
downloadbitcoin-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.h')
-rw-r--r--src/txmempool.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/txmempool.h b/src/txmempool.h
index 460e9d0ceb..1fd0c70891 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -782,7 +782,6 @@ public:
}
return (mapTx.count(gtxid.GetHash()) != 0);
}
- bool exists(const uint256& txid) const { return exists(GenTxid{false, txid}); }
CTransactionRef get(const uint256& hash) const;
txiter get_iter_from_wtxid(const uint256& wtxid) const EXCLUSIVE_LOCKS_REQUIRED(cs)
@@ -802,7 +801,7 @@ public:
LOCK(cs);
// Sanity check the transaction is in the mempool & insert into
// unbroadcast set.
- if (exists(txid)) m_unbroadcast_txids.insert(txid);
+ if (exists(GenTxid::Txid(txid))) m_unbroadcast_txids.insert(txid);
};
/** Removes a transaction from the unbroadcast set */