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 @@ -97,21 +97,25 @@ struct CompareTxIterByAncestorCount {
97
97
}
98
98
};
99
99
100
+
101
+ struct CTxMemPoolModifiedEntry_Indices final : 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
+ >
114
+ {};
115
+
100
116
typedef boost::multi_index_container<
101
117
CTxMemPoolModifiedEntry,
102
- boost::multi_index::indexed_by<
103
- boost::multi_index::ordered_unique<
104
- modifiedentry_iter,
105
- CompareCTxMemPoolIter
106
- >,
107
- // sorted by modified ancestor fee rate
108
- boost::multi_index::ordered_non_unique<
109
- // Reuse same tag from CTxMemPool's similar index
110
- boost::multi_index::tag<ancestor_score>,
111
- boost::multi_index::identity<CTxMemPoolModifiedEntry>,
112
- CompareTxMemPoolEntryByAncestorFee
113
- >
114
- >
118
+ CTxMemPoolModifiedEntry_Indices
115
119
> indexed_modified_transaction_set;
116
120
117
121
typedef indexed_modified_transaction_set::nth_index<0 >::type::iterator modtxiter;
Original file line number Diff line number Diff line change @@ -329,9 +329,7 @@ class CTxMemPool
329
329
330
330
static const int ROLLING_FEE_HALFLIFE = 60 * 60 * 12 ; // public only for testing
331
331
332
- typedef boost::multi_index_container<
333
- CTxMemPoolEntry,
334
- boost::multi_index::indexed_by<
332
+ struct CTxMemPoolEntry_Indices final : boost::multi_index::indexed_by<
335
333
// sorted by txid
336
334
boost::multi_index::hashed_unique<mempoolentry_txid, SaltedTxidHasher>,
337
335
// sorted by wtxid
@@ -359,6 +357,10 @@ class CTxMemPool
359
357
CompareTxMemPoolEntryByAncestorFee
360
358
>
361
359
>
360
+ {};
361
+ typedef boost::multi_index_container<
362
+ CTxMemPoolEntry,
363
+ CTxMemPoolEntry_Indices
362
364
> indexed_transaction_set;
363
365
364
366
/* *
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