@@ -302,7 +302,7 @@ struct Peer {
302302 * non-wtxid-relay peers, wtxid for wtxid-relay peers). We use the
303303 * mempool to sort transactions in dependency order before relay, so
304304 * this does not have to be sorted. */
305- std::set<GenTxidVariant > m_tx_inventory_to_send GUARDED_BY (m_tx_inventory_mutex);
305+ std::set<GenTxid > m_tx_inventory_to_send GUARDED_BY (m_tx_inventory_mutex);
306306 /* * Whether the peer has requested us to send our complete mempool. Only
307307 * permitted if the peer has NetPermissionFlags::Mempool or we advertise
308308 * NODE_BLOOM. See BIP35. */
@@ -856,7 +856,7 @@ class PeerManagerImpl final : public PeerManager
856856 std::shared_ptr<const CBlock> m_most_recent_block GUARDED_BY (m_most_recent_block_mutex);
857857 std::shared_ptr<const CBlockHeaderAndShortTxIDs> m_most_recent_compact_block GUARDED_BY (m_most_recent_block_mutex);
858858 uint256 m_most_recent_block_hash GUARDED_BY (m_most_recent_block_mutex);
859- std::unique_ptr<const std::map<GenTxidVariant , CTransactionRef>> m_most_recent_block_txs GUARDED_BY (m_most_recent_block_mutex);
859+ std::unique_ptr<const std::map<GenTxid , CTransactionRef>> m_most_recent_block_txs GUARDED_BY (m_most_recent_block_mutex);
860860
861861 // Data about the low-work headers synchronization, aggregated from all peers' HeadersSyncStates.
862862 /* * Mutex guarding the other m_headers_presync_* variables. */
@@ -2027,7 +2027,7 @@ void PeerManagerImpl::NewPoWValidBlock(const CBlockIndex *pindex, const std::sha
20272027 std::async (std::launch::deferred, [&] { return NetMsg::Make (NetMsgType::CMPCTBLOCK, *pcmpctblock); })};
20282028
20292029 {
2030- auto most_recent_block_txs = std::make_unique<std::map<GenTxidVariant , CTransactionRef>>();
2030+ auto most_recent_block_txs = std::make_unique<std::map<GenTxid , CTransactionRef>>();
20312031 for (const auto & tx : pblock->vtx ) {
20322032 most_recent_block_txs->emplace (tx->GetHash (), tx);
20332033 most_recent_block_txs->emplace (tx->GetWitnessHash (), tx);
@@ -2166,7 +2166,7 @@ void PeerManagerImpl::RelayTransaction(const Txid& txid, const Wtxid& wtxid)
21662166 // in the announcement.
21672167 if (tx_relay->m_next_inv_send_time == 0s) continue ;
21682168
2169- const auto gtxid{peer.m_wtxid_relay ? GenTxidVariant {wtxid} : GenTxidVariant {txid}};
2169+ const auto gtxid{peer.m_wtxid_relay ? GenTxid {wtxid} : GenTxid {txid}};
21702170 if (!tx_relay->m_tx_inventory_known_filter .contains (gtxid.ToUint256 ())) {
21712171 tx_relay->m_tx_inventory_to_send .insert (gtxid);
21722172 }
@@ -4011,7 +4011,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
40114011 pfrom.fDisconnect = true ;
40124012 return ;
40134013 }
4014- const GenTxidVariant gtxid = ToGenTxid (inv);
4014+ const GenTxid gtxid = ToGenTxid (inv);
40154015 AddKnownTx (*peer, inv.hash );
40164016
40174017 if (!m_chainman.IsInitialBlockDownload ()) {
@@ -4942,7 +4942,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
49424942 if (msg_type == NetMsgType::NOTFOUND) {
49434943 std::vector<CInv> vInv;
49444944 vRecv >> vInv;
4945- std::vector<GenTxidVariant > tx_invs;
4945+ std::vector<GenTxid > tx_invs;
49464946 if (vInv.size () <= node::MAX_PEER_TX_ANNOUNCEMENTS + MAX_BLOCKS_IN_TRANSIT_PER_PEER) {
49474947 for (CInv &inv : vInv) {
49484948 if (inv.IsGenTxMsg ()) {
@@ -5450,7 +5450,7 @@ class CompareInvMempoolOrder
54505450public:
54515451 explicit CompareInvMempoolOrder (CTxMemPool* mempool) : m_mempool{mempool} {}
54525452
5453- bool operator ()(std::set<GenTxidVariant >::iterator a, std::set<GenTxidVariant >::iterator b)
5453+ bool operator ()(std::set<GenTxid >::iterator a, std::set<GenTxid >::iterator b)
54545454 {
54555455 /* As std::make_heap produces a max-heap, we want the entries with the
54565456 * fewest ancestors/highest fee to sort later. */
@@ -5793,9 +5793,9 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
57935793 // Determine transactions to relay
57945794 if (fSendTrickle ) {
57955795 // Produce a vector with all candidates for sending
5796- std::vector<std::set<GenTxidVariant >::iterator> vInvTx;
5796+ std::vector<std::set<GenTxid >::iterator> vInvTx;
57975797 vInvTx.reserve (tx_relay->m_tx_inventory_to_send .size ());
5798- for (std::set<GenTxidVariant >::iterator it = tx_relay->m_tx_inventory_to_send .begin (); it != tx_relay->m_tx_inventory_to_send .end (); it++) {
5798+ for (std::set<GenTxid >::iterator it = tx_relay->m_tx_inventory_to_send .begin (); it != tx_relay->m_tx_inventory_to_send .end (); it++) {
57995799 vInvTx.push_back (it);
58005800 }
58015801 const CFeeRate filterrate{tx_relay->m_fee_filter_received .load ()};
@@ -5812,9 +5812,9 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
58125812 while (!vInvTx.empty () && nRelayedTransactions < broadcast_max) {
58135813 // Fetch the top element from the heap
58145814 std::pop_heap (vInvTx.begin (), vInvTx.end (), compareInvMempoolOrder);
5815- std::set<GenTxidVariant >::iterator it = vInvTx.back ();
5815+ std::set<GenTxid >::iterator it = vInvTx.back ();
58165816 vInvTx.pop_back ();
5817- GenTxidVariant hash = *it;
5817+ GenTxid hash = *it;
58185818 Assume (peer->m_wtxid_relay == hash.IsWtxid ());
58195819 CInv inv (peer->m_wtxid_relay ? MSG_WTX : MSG_TX, hash.ToUint256 ());
58205820 // Remove it from the to-be-sent set
@@ -5962,7 +5962,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
59625962 //
59635963 {
59645964 LOCK (m_tx_download_mutex);
5965- for (const GenTxidVariant & gtxid : m_txdownloadman.GetRequestsToSend (pto->GetId (), current_time)) {
5965+ for (const GenTxid & gtxid : m_txdownloadman.GetRequestsToSend (pto->GetId (), current_time)) {
59665966 vGetData.emplace_back (gtxid.IsWtxid () ? MSG_WTX : (MSG_TX | GetFetchFlags (*peer)), gtxid.ToUint256 ());
59675967 if (vGetData.size () >= MAX_GETDATA_SZ) {
59685968 MakeAndPushMessage (*pto, NetMsgType::GETDATA, vGetData);
0 commit comments