File tree Expand file tree Collapse file tree 3 files changed +30
-21
lines changed Expand file tree Collapse file tree 3 files changed +30
-21
lines changed Original file line number Diff line number Diff line change @@ -96,21 +96,25 @@ struct CompareTxIterByAncestorCount {
96
96
}
97
97
};
98
98
99
+
100
+ struct CTxMemPoolModifiedEntry_Indices final : boost::multi_index::indexed_by<
101
+ boost::multi_index::ordered_unique<
102
+ modifiedentry_iter,
103
+ CompareCTxMemPoolIter
104
+ >,
105
+ // sorted by modified ancestor fee rate
106
+ boost::multi_index::ordered_non_unique<
107
+ // Reuse same tag from CTxMemPool's similar index
108
+ boost::multi_index::tag<ancestor_score>,
109
+ boost::multi_index::identity<CTxMemPoolModifiedEntry>,
110
+ CompareTxMemPoolEntryByAncestorFee
111
+ >
112
+ >
113
+ {};
114
+
99
115
typedef boost::multi_index_container<
100
116
CTxMemPoolModifiedEntry,
101
- boost::multi_index::indexed_by<
102
- boost::multi_index::ordered_unique<
103
- modifiedentry_iter,
104
- CompareCTxMemPoolIter
105
- >,
106
- // sorted by modified ancestor fee rate
107
- boost::multi_index::ordered_non_unique<
108
- // Reuse same tag from CTxMemPool's similar index
109
- boost::multi_index::tag<ancestor_score>,
110
- boost::multi_index::identity<CTxMemPoolModifiedEntry>,
111
- CompareTxMemPoolEntryByAncestorFee
112
- >
113
- >
117
+ CTxMemPoolModifiedEntry_Indices
114
118
> indexed_modified_transaction_set;
115
119
116
120
typedef indexed_modified_transaction_set::nth_index<0 >::type::iterator modtxiter;
Original file line number Diff line number Diff line change @@ -327,9 +327,7 @@ class CTxMemPool
327
327
328
328
static const int ROLLING_FEE_HALFLIFE = 60 * 60 * 12 ; // public only for testing
329
329
330
- typedef boost::multi_index_container<
331
- CTxMemPoolEntry,
332
- boost::multi_index::indexed_by<
330
+ struct CTxMemPoolEntry_Indices final : boost::multi_index::indexed_by<
333
331
// sorted by txid
334
332
boost::multi_index::hashed_unique<mempoolentry_txid, SaltedTxidHasher>,
335
333
// sorted by wtxid
@@ -357,6 +355,10 @@ class CTxMemPool
357
355
CompareTxMemPoolEntryByAncestorFee
358
356
>
359
357
>
358
+ {};
359
+ typedef boost::multi_index_container<
360
+ CTxMemPoolEntry,
361
+ CTxMemPoolEntry_Indices
360
362
> indexed_transaction_set;
361
363
362
364
/* *
Original file line number Diff line number Diff line change @@ -212,14 +212,17 @@ struct ByTimeViewExtractor
212
212
}
213
213
};
214
214
215
+ struct Announcement_Indices final : boost::multi_index::indexed_by<
216
+ boost::multi_index::ordered_unique<boost::multi_index::tag<ByPeer>, ByPeerViewExtractor>,
217
+ boost::multi_index::ordered_non_unique<boost::multi_index::tag<ByTxHash>, ByTxHashViewExtractor>,
218
+ boost::multi_index::ordered_non_unique<boost::multi_index::tag<ByTime>, ByTimeViewExtractor>
219
+ >
220
+ {};
221
+
215
222
/* * Data type for the main data structure (Announcement objects with ByPeer/ByTxHash/ByTime indexes). */
216
223
using Index = boost::multi_index_container<
217
224
Announcement,
218
- boost::multi_index::indexed_by<
219
- boost::multi_index::ordered_unique<boost::multi_index::tag<ByPeer>, ByPeerViewExtractor>,
220
- boost::multi_index::ordered_non_unique<boost::multi_index::tag<ByTxHash>, ByTxHashViewExtractor>,
221
- boost::multi_index::ordered_non_unique<boost::multi_index::tag<ByTime>, ByTimeViewExtractor>
222
- >
225
+ Announcement_Indices
223
226
>;
224
227
225
228
/* * Helper type to simplify syntax of iterator types. */
You can’t perform that action at this time.
0 commit comments