mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 11:32:46 +01:00
refactor: implement minimal RelayInv which doesn't rely on m_connman
Vast majority of usages of RelayInv don't use the minProtoVersion, we may as well have these not contribute to contention of m_nodes_mutex / use m_connman
This commit is contained in:
parent
c2b83dc80e
commit
94da0de6ef
@ -614,6 +614,7 @@ public:
|
||||
bool IgnoresIncomingTxs() override { return m_ignore_incoming_txs; }
|
||||
void SendPings() override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);;
|
||||
void PushInventory(NodeId nodeid, const CInv& inv) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
||||
void RelayInv(CInv &inv) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
||||
void RelayInv(CInv &inv, const int minProtoVersion) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
||||
void RelayInvFiltered(CInv &inv, const CTransaction &relatedTx, const int minProtoVersion) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
||||
void RelayInvFiltered(CInv &inv, const uint256 &relatedTxHash, const int minProtoVersion) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
|
||||
@ -2289,6 +2290,15 @@ void PeerManagerImpl::RelayInv(CInv &inv, const int minProtoVersion)
|
||||
});
|
||||
}
|
||||
|
||||
void PeerManagerImpl::RelayInv(CInv &inv)
|
||||
{
|
||||
LOCK(m_peer_mutex);
|
||||
for (const auto& [_, peer] : m_peer_map) {
|
||||
if (!peer->GetInvRelay()) continue;
|
||||
PushInv(*peer, inv);
|
||||
}
|
||||
}
|
||||
|
||||
void PeerManagerImpl::RelayDSQ(const CCoinJoinQueue& queue)
|
||||
{
|
||||
CInv inv{MSG_DSQ, queue.GetHash()};
|
||||
|
@ -98,7 +98,8 @@ public:
|
||||
virtual void RelayDSQ(const CCoinJoinQueue& queue) = 0;
|
||||
|
||||
/** Relay inventories to all peers */
|
||||
virtual void RelayInv(CInv &inv, const int minProtoVersion = MIN_PEER_PROTO_VERSION) = 0;
|
||||
virtual void RelayInv(CInv &inv) = 0;
|
||||
virtual void RelayInv(CInv &inv, const int minProtoVersion) = 0;
|
||||
virtual void RelayInvFiltered(CInv &inv, const CTransaction &relatedTx,
|
||||
const int minProtoVersion = MIN_PEER_PROTO_VERSION) = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user