diff --git a/src/node/miner.h b/src/node/miner.h index efd773eb31..1b82943766 100644 --- a/src/node/miner.h +++ b/src/node/miner.h @@ -97,21 +97,25 @@ struct CompareTxIterByAncestorCount { } }; + +struct CTxMemPoolModifiedEntry_Indices final : boost::multi_index::indexed_by< + boost::multi_index::ordered_unique< + modifiedentry_iter, + CompareCTxMemPoolIter + >, + // sorted by modified ancestor fee rate + boost::multi_index::ordered_non_unique< + // Reuse same tag from CTxMemPool's similar index + boost::multi_index::tag, + boost::multi_index::identity, + CompareTxMemPoolEntryByAncestorFee + > +> +{}; + typedef boost::multi_index_container< CTxMemPoolModifiedEntry, - boost::multi_index::indexed_by< - boost::multi_index::ordered_unique< - modifiedentry_iter, - CompareCTxMemPoolIter - >, - // sorted by modified ancestor fee rate - boost::multi_index::ordered_non_unique< - // Reuse same tag from CTxMemPool's similar index - boost::multi_index::tag, - boost::multi_index::identity, - CompareTxMemPoolEntryByAncestorFee - > - > + CTxMemPoolModifiedEntry_Indices > indexed_modified_transaction_set; typedef indexed_modified_transaction_set::nth_index<0>::type::iterator modtxiter; diff --git a/src/txmempool.h b/src/txmempool.h index 302addc8f0..d0cb41a078 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -329,9 +329,7 @@ public: static const int ROLLING_FEE_HALFLIFE = 60 * 60 * 12; // public only for testing - typedef boost::multi_index_container< - CTxMemPoolEntry, - boost::multi_index::indexed_by< + struct CTxMemPoolEntry_Indices final : boost::multi_index::indexed_by< // sorted by txid boost::multi_index::hashed_unique, // sorted by wtxid @@ -359,6 +357,10 @@ public: CompareTxMemPoolEntryByAncestorFee > > + {}; + typedef boost::multi_index_container< + CTxMemPoolEntry, + CTxMemPoolEntry_Indices > indexed_transaction_set; /** diff --git a/src/txrequest.cpp b/src/txrequest.cpp index 6338ccb118..96ea716481 100644 --- a/src/txrequest.cpp +++ b/src/txrequest.cpp @@ -212,14 +212,17 @@ struct ByTimeViewExtractor } }; +struct Announcement_Indices final : boost::multi_index::indexed_by< + boost::multi_index::ordered_unique, ByPeerViewExtractor>, + boost::multi_index::ordered_non_unique, ByTxHashViewExtractor>, + boost::multi_index::ordered_non_unique, ByTimeViewExtractor> +> +{}; + /** Data type for the main data structure (Announcement objects with ByPeer/ByTxHash/ByTime indexes). */ using Index = boost::multi_index_container< Announcement, - boost::multi_index::indexed_by< - boost::multi_index::ordered_unique, ByPeerViewExtractor>, - boost::multi_index::ordered_non_unique, ByTxHashViewExtractor>, - boost::multi_index::ordered_non_unique, ByTimeViewExtractor> - > + Announcement_Indices >; /** Helper type to simplify syntax of iterator types. */