@@ -856,7 +856,7 @@ class PeerManagerImpl final : public PeerManager
856
856
std::shared_ptr<const CBlock> m_most_recent_block GUARDED_BY (m_most_recent_block_mutex);
857
857
std::shared_ptr<const CBlockHeaderAndShortTxIDs> m_most_recent_compact_block GUARDED_BY (m_most_recent_block_mutex);
858
858
uint256 m_most_recent_block_hash GUARDED_BY (m_most_recent_block_mutex);
859
- std::unique_ptr<const std::map<uint256 , CTransactionRef>> m_most_recent_block_txs 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);
860
860
861
861
// Data about the low-work headers synchronization, aggregated from all peers' HeadersSyncStates.
862
862
/* * Mutex guarding the other m_headers_presync_* variables. */
@@ -2027,7 +2027,7 @@ void PeerManagerImpl::NewPoWValidBlock(const CBlockIndex *pindex, const std::sha
2027
2027
std::async (std::launch::deferred, [&] { return NetMsg::Make (NetMsgType::CMPCTBLOCK, *pcmpctblock); })};
2028
2028
2029
2029
{
2030
- auto most_recent_block_txs = std::make_unique<std::map<uint256 , CTransactionRef>>();
2030
+ auto most_recent_block_txs = std::make_unique<std::map<GenTxidVariant , CTransactionRef>>();
2031
2031
for (const auto & tx : pblock->vtx ) {
2032
2032
most_recent_block_txs->emplace (tx->GetHash (), tx);
2033
2033
most_recent_block_txs->emplace (tx->GetWitnessHash (), tx);
@@ -2393,7 +2393,7 @@ void PeerManagerImpl::ProcessGetBlockData(CNode& pfrom, Peer& peer, const CInv&
2393
2393
2394
2394
CTransactionRef PeerManagerImpl::FindTxForGetData (const Peer::TxRelay& tx_relay, const CInv& inv)
2395
2395
{
2396
- auto gtxid{ToGenTxid (inv). ToVariant () };
2396
+ auto gtxid{ToGenTxid (inv)};
2397
2397
// If a tx was in the mempool prior to the last INV for this peer, permit the request.
2398
2398
auto txinfo{std::visit (
2399
2399
[&](const auto & id) EXCLUSIVE_LOCKS_REQUIRED (NetEventsInterface::g_msgproc_mutex) {
@@ -2408,7 +2408,7 @@ CTransactionRef PeerManagerImpl::FindTxForGetData(const Peer::TxRelay& tx_relay,
2408
2408
{
2409
2409
LOCK (m_most_recent_block_mutex);
2410
2410
if (m_most_recent_block_txs != nullptr ) {
2411
- auto it = m_most_recent_block_txs->find (gtxid. ToUint256 () );
2411
+ auto it = m_most_recent_block_txs->find (gtxid);
2412
2412
if (it != m_most_recent_block_txs->end ()) return it->second ;
2413
2413
}
2414
2414
}
@@ -4011,11 +4011,11 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4011
4011
pfrom.fDisconnect = true ;
4012
4012
return ;
4013
4013
}
4014
- const GenTxid gtxid = ToGenTxid (inv);
4014
+ const GenTxidVariant gtxid = ToGenTxid (inv);
4015
4015
AddKnownTx (*peer, inv.hash );
4016
4016
4017
4017
if (!m_chainman.IsInitialBlockDownload ()) {
4018
- const bool fAlreadyHave {m_txdownloadman.AddTxAnnouncement (pfrom.GetId (), gtxid. ToVariant () , current_time)};
4018
+ const bool fAlreadyHave {m_txdownloadman.AddTxAnnouncement (pfrom.GetId (), gtxid, current_time)};
4019
4019
LogDebug (BCLog::NET, " got inv: %s %s peer=%d\n " , inv.ToString (), fAlreadyHave ? " have" : " new" , pfrom.GetId ());
4020
4020
}
4021
4021
} else {
@@ -4946,7 +4946,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
4946
4946
if (vInv.size () <= node::MAX_PEER_TX_ANNOUNCEMENTS + MAX_BLOCKS_IN_TRANSIT_PER_PEER) {
4947
4947
for (CInv &inv : vInv) {
4948
4948
if (inv.IsGenTxMsg ()) {
4949
- tx_invs.emplace_back (ToGenTxid (inv). ToVariant () );
4949
+ tx_invs.emplace_back (ToGenTxid (inv));
4950
4950
}
4951
4951
}
4952
4952
}
@@ -5772,7 +5772,7 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
5772
5772
txinfo.tx ->GetWitnessHash ().ToUint256 () :
5773
5773
txinfo.tx ->GetHash ().ToUint256 (),
5774
5774
};
5775
- tx_relay->m_tx_inventory_to_send .erase (ToGenTxid (inv). ToVariant () );
5775
+ tx_relay->m_tx_inventory_to_send .erase (ToGenTxid (inv));
5776
5776
5777
5777
// Don't send transactions that peers will not put into their mempool
5778
5778
if (txinfo.fee < filterrate.GetFee (txinfo.vsize )) {
0 commit comments