diff --git a/src/txmempool.cpp b/src/txmempool.cpp index e63bff2a9ca..49961896f7c 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -988,7 +988,7 @@ util::Result, std::vector>> CTxMemPool:: CTxMemPool::ChangeSet::TxHandle CTxMemPool::ChangeSet::StageAddition(const CTransactionRef& tx, const CAmount fee, int64_t time, unsigned int entry_height, uint64_t entry_sequence, bool spends_coinbase, int64_t sigops_cost, LockPoints lp) { LOCK(m_pool->cs); - Assume(!m_to_add.contains(tx->GetHash())); + Assume(m_to_add.find(tx->GetHash()) == m_to_add.end()); Assume(!m_dependencies_processed); // We need to process dependencies after adding a new transaction. diff --git a/src/txrequest.cpp b/src/txrequest.cpp index bb013b0fa7b..4d7240bee0d 100644 --- a/src/txrequest.cpp +++ b/src/txrequest.cpp @@ -580,7 +580,7 @@ public: // Bail out if we already have a CANDIDATE_BEST announcement for this (txhash, peer) combination. The case // where there is a non-CANDIDATE_BEST announcement already will be caught by the uniqueness property of the // ByPeer index when we try to emplace the new object below. - if (m_index.get().contains(ByPeerView{peer, true, gtxid.ToUint256()})) return; + if (m_index.get().count(ByPeerView{peer, true, gtxid.ToUint256()})) return; // Try creating the announcement with CANDIDATE_DELAYED state (which will fail due to the uniqueness // of the ByPeer index if a non-CANDIDATE_BEST announcement already exists with the same txhash and peer).