From fd9f1accbda9e81b2c5290b2056b25f02152a607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rinc?= Date: Thu, 18 Dec 2025 22:36:35 +0100 Subject: [PATCH] Fix compilation for old Boost versions Fixes https://github.com/bitcoin/bitcoin/issues/34101 by reverting `boost::multi_index::contains` calls only available in Boost 1.78.0 --- src/txmempool.cpp | 2 +- src/txrequest.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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).