diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-11-16 07:51:21 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-11-16 07:50:27 +0100 |
commit | fa074d2c7b9c3d34876c428d12672a505d4ce4eb (patch) | |
tree | 26338f3d5945b898c8ea9dfbd13d32679ec81040 /src/txmempool.h | |
parent | a339289c2ef9caffa1195436695a13f6e48e1bbc (diff) | |
download | bitcoin-fa074d2c7b9c3d34876c428d12672a505d4ce4eb.tar.xz |
Revert "Merge #19606: Backport wtxid relay to v0.20"
This reverts commit a339289c2ef9caffa1195436695a13f6e48e1bbc, reversing
changes made to b9ac31f2d29ae3e79c0f0cde5bab2d7213e6da51.
Diffstat (limited to 'src/txmempool.h')
-rw-r--r-- | src/txmempool.h | 42 |
1 files changed, 5 insertions, 37 deletions
diff --git a/src/txmempool.h b/src/txmempool.h index 40986f13a3..3dae0a04c7 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -198,22 +198,6 @@ struct mempoolentry_txid } }; -// extracts a transaction witness-hash from CTxMemPoolEntry or CTransactionRef -struct mempoolentry_wtxid -{ - typedef uint256 result_type; - result_type operator() (const CTxMemPoolEntry &entry) const - { - return entry.GetTx().GetWitnessHash(); - } - - result_type operator() (const CTransactionRef& tx) const - { - return tx->GetWitnessHash(); - } -}; - - /** \class CompareTxMemPoolEntryByDescendantScore * * Sort an entry by max(score/size of entry's tx, score/size with all descendants). @@ -334,7 +318,6 @@ public: struct descendant_score {}; struct entry_time {}; struct ancestor_score {}; -struct index_by_wtxid {}; class CBlockPolicyEstimator; @@ -400,9 +383,8 @@ public: * * CTxMemPool::mapTx, and CTxMemPoolEntry bookkeeping: * - * mapTx is a boost::multi_index that sorts the mempool on 5 criteria: - * - transaction hash (txid) - * - witness-transaction hash (wtxid) + * mapTx is a boost::multi_index that sorts the mempool on 4 criteria: + * - transaction hash * - descendant feerate [we use max(feerate of tx, feerate of tx with all descendants)] * - time in mempool * - ancestor feerate [we use min(feerate of tx, feerate of tx with all unconfirmed ancestors)] @@ -487,12 +469,6 @@ public: boost::multi_index::indexed_by< // sorted by txid boost::multi_index::hashed_unique<mempoolentry_txid, SaltedTxidHasher>, - // sorted by wtxid - boost::multi_index::hashed_unique< - boost::multi_index::tag<index_by_wtxid>, - mempoolentry_wtxid, - SaltedTxidHasher - >, // sorted by fee rate boost::multi_index::ordered_non_unique< boost::multi_index::tag<descendant_score>, @@ -607,7 +583,7 @@ public: void clear(); void _clear() EXCLUSIVE_LOCKS_REQUIRED(cs); //lock free - bool CompareDepthAndScore(const uint256& hasha, const uint256& hashb, bool wtxid=false); + bool CompareDepthAndScore(const uint256& hasha, const uint256& hashb); void queryHashes(std::vector<uint256>& vtxid) const; bool isSpent(const COutPoint& outpoint) const; unsigned int GetTransactionsUpdated() const; @@ -710,22 +686,14 @@ public: return totalTxSize; } - bool exists(const uint256& hash, bool wtxid=false) const + bool exists(const uint256& hash) const { LOCK(cs); - if (wtxid) { - return (mapTx.get<index_by_wtxid>().count(hash) != 0); - } return (mapTx.count(hash) != 0); } CTransactionRef get(const uint256& hash) const; - txiter get_iter_from_wtxid(const uint256& wtxid) const EXCLUSIVE_LOCKS_REQUIRED(cs) - { - AssertLockHeld(cs); - return mapTx.project<0>(mapTx.get<index_by_wtxid>().find(wtxid)); - } - TxMempoolInfo info(const uint256& hash, bool wtxid=false) const; + TxMempoolInfo info(const uint256& hash) const; std::vector<TxMempoolInfo> infoAll() const; size_t DynamicMemoryUsage() const; |