@@ -909,7 +909,7 @@ class PeerManagerImpl final : public PeerManager
909
909
910
910
/* * Determine whether or not a peer can request a transaction, and return it (or nullptr if not found or not allowed). */
911
911
CTransactionRef FindTxForGetData (const Peer& peer, const GenTxid& gtxid, const std::chrono::seconds mempool_req, const std::chrono::seconds now)
912
- LOCKS_EXCLUDED(cs_main) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface::g_msgproc_mutex);
912
+ EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface::g_msgproc_mutex);
913
913
914
914
void ProcessGetData (CNode& pfrom, Peer& peer, const std::atomic<bool >& interruptMsgProc)
915
915
EXCLUSIVE_LOCKS_REQUIRED(!m_most_recent_block_mutex, peer.m_getdata_requests_mutex, NetEventsInterface::g_msgproc_mutex)
@@ -920,9 +920,9 @@ class PeerManagerImpl final : public PeerManager
920
920
921
921
/* * Relay map (txid or wtxid -> CTransactionRef) */
922
922
typedef std::map<uint256, CTransactionRef> MapRelay;
923
- MapRelay mapRelay GUARDED_BY (cs_main );
923
+ MapRelay mapRelay GUARDED_BY (NetEventsInterface::g_msgproc_mutex );
924
924
/* * Expiration-time ordered list of (expire time, relay map entry) pairs. */
925
- std::deque<std::pair<std::chrono::microseconds, MapRelay::iterator>> g_relay_expiration GUARDED_BY (cs_main );
925
+ std::deque<std::pair<std::chrono::microseconds, MapRelay::iterator>> g_relay_expiration GUARDED_BY (NetEventsInterface::g_msgproc_mutex );
926
926
927
927
/* *
928
928
* When a peer sends us a valid block, instruct it to announce blocks to us
@@ -2270,16 +2270,13 @@ CTransactionRef PeerManagerImpl::FindTxForGetData(const Peer& peer, const GenTxi
2270
2270
}
2271
2271
}
2272
2272
2273
- {
2274
- LOCK (cs_main);
2275
- // Otherwise, the transaction must have been announced recently.
2276
- if (Assume (peer.GetTxRelay ())->m_recently_announced_invs .contains (gtxid.GetHash ())) {
2277
- // If it was, it can be relayed from either the mempool...
2278
- if (txinfo.tx ) return std::move (txinfo.tx );
2279
- // ... or the relay pool.
2280
- auto mi = mapRelay.find (gtxid.GetHash ());
2281
- if (mi != mapRelay.end ()) return mi->second ;
2282
- }
2273
+ // Otherwise, the transaction must have been announced recently.
2274
+ if (Assume (peer.GetTxRelay ())->m_recently_announced_invs .contains (gtxid.GetHash ())) {
2275
+ // If it was, it can be relayed from either the mempool...
2276
+ if (txinfo.tx ) return std::move (txinfo.tx );
2277
+ // ... or the relay pool.
2278
+ auto mi = mapRelay.find (gtxid.GetHash ());
2279
+ if (mi != mapRelay.end ()) return mi->second ;
2283
2280
}
2284
2281
2285
2282
return {};
0 commit comments