Skip to content

Commit a425211

Browse files
perf: bail out in RelayInvFiltered early if !CanRelay
1 parent f170aed commit a425211

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/net_processing.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2406,11 +2406,13 @@ void PeerManagerImpl::RelayInvFiltered(const CInv& inv, const CTransaction& rela
24062406
{
24072407
// TODO: Migrate to iteration through m_peer_map
24082408
m_connman.ForEachNode([&](CNode* pnode) {
2409+
if (!pnode->CanRelay()) return;
2410+
24092411
PeerRef peer = GetPeerRef(pnode->GetId());
24102412
if (peer == nullptr) return;
24112413

24122414
auto tx_relay = peer->GetTxRelay();
2413-
if (!pnode->CanRelay() || tx_relay == nullptr) {
2415+
if (tx_relay == nullptr) {
24142416
return;
24152417
}
24162418

0 commit comments

Comments
 (0)