Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/node/miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ struct CompareTxIterByAncestorCount {
};


struct CTxMemPoolModifiedEntry_Indices final : boost::multi_index::indexed_by<
using indexed_modified_transaction_set = boost::multi_index_container<
CTxMemPoolModifiedEntry,
boost::multi_index::indexed_by<
boost::multi_index::ordered_unique<
modifiedentry_iter,
CompareCTxMemPoolIter
Expand All @@ -116,12 +118,7 @@ struct CTxMemPoolModifiedEntry_Indices final : boost::multi_index::indexed_by<
CompareTxMemPoolEntryByAncestorFee
>
>
{};

typedef boost::multi_index_container<
CTxMemPoolModifiedEntry,
CTxMemPoolModifiedEntry_Indices
> indexed_modified_transaction_set;
>;

typedef indexed_modified_transaction_set::nth_index<0>::type::iterator modtxiter;
typedef indexed_modified_transaction_set::index<ancestor_score>::type::iterator modtxscoreiter;
Expand Down
10 changes: 4 additions & 6 deletions src/txmempool.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ class CTxMemPool

static const int ROLLING_FEE_HALFLIFE = 60 * 60 * 12; // public only for testing

struct CTxMemPoolEntry_Indices final : boost::multi_index::indexed_by<
using indexed_transaction_set = boost::multi_index_container<
CTxMemPoolEntry,
boost::multi_index::indexed_by<
// sorted by txid
boost::multi_index::hashed_unique<mempoolentry_txid, SaltedTxidHasher>,
// sorted by wtxid
Expand Down Expand Up @@ -372,11 +374,7 @@ class CTxMemPool
CompareTxMemPoolEntryByAncestorFee
>
>
{};
typedef boost::multi_index_container<
CTxMemPoolEntry,
CTxMemPoolEntry_Indices
> indexed_transaction_set;
>;

/**
* This mutex needs to be locked when accessing `mapTx` or other members
Expand Down
12 changes: 5 additions & 7 deletions src/txrequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,15 @@ struct ByTimeViewExtractor
}
};

struct Announcement_Indices final : boost::multi_index::indexed_by<
boost::multi_index::ordered_unique<boost::multi_index::tag<ByPeer>, ByPeerViewExtractor>,
boost::multi_index::ordered_non_unique<boost::multi_index::tag<ByTxHash>, ByTxHashViewExtractor>,
boost::multi_index::ordered_non_unique<boost::multi_index::tag<ByTime>, ByTimeViewExtractor>
>
{};

/** Data type for the main data structure (Announcement objects with ByPeer/ByTxHash/ByTime indexes). */
using Index = boost::multi_index_container<
Announcement,
Announcement_Indices
boost::multi_index::indexed_by<
boost::multi_index::ordered_unique<boost::multi_index::tag<ByPeer>, ByPeerViewExtractor>,
boost::multi_index::ordered_non_unique<boost::multi_index::tag<ByTxHash>, ByTxHashViewExtractor>,
boost::multi_index::ordered_non_unique<boost::multi_index::tag<ByTime>, ByTimeViewExtractor>
>
>;

/** Helper type to simplify syntax of iterator types. */
Expand Down