From 4307849256761fe2440d82bbec892d0e8e6b4dd4 Mon Sep 17 00:00:00 2001 From: glozow Date: Wed, 20 Oct 2021 16:41:45 +0100 Subject: [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. --- src/txmempool.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/txmempool.h') 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 */ -- cgit v1.2.3