mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
refactor: move expensive CInv initialization out of hot loop
This commit is contained in:
parent
0f39da9631
commit
b65f0bab7f
@ -2328,13 +2328,13 @@ void PeerManagerImpl::RelayInvFiltered(CInv &inv, const uint256& relatedTxHash,
|
|||||||
|
|
||||||
void PeerManagerImpl::RelayTransaction(const uint256& txid)
|
void PeerManagerImpl::RelayTransaction(const uint256& txid)
|
||||||
{
|
{
|
||||||
|
const CInv inv{m_cj_ctx->dstxman->GetDSTX(txid) ? MSG_DSTX : MSG_TX, txid};
|
||||||
LOCK(m_peer_mutex);
|
LOCK(m_peer_mutex);
|
||||||
for(auto& it : m_peer_map) {
|
for(auto& it : m_peer_map) {
|
||||||
Peer& peer = *it.second;
|
Peer& peer = *it.second;
|
||||||
auto tx_relay = peer.GetTxRelay();
|
auto tx_relay = peer.GetTxRelay();
|
||||||
if (!tx_relay) continue;
|
if (!tx_relay) continue;
|
||||||
|
|
||||||
const CInv inv{m_cj_ctx->dstxman->GetDSTX(txid) ? MSG_DSTX : MSG_TX, txid};
|
|
||||||
PushInv(peer, inv);
|
PushInv(peer, inv);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user