Page MenuHomePhabricator

[net processing] Don't initialize TxRelay for non-tx-relay peers.

Authored by PiRK on Mon, Nov 6, 08:41.



[net processing] Add m_tx_relay_mutex to protect m_tx_relay ptr

[net processing] Don't initialize TxRelay for non-tx-relay peers.

Delay initializing the TxRelay data structure for a peer until we receive
a version message from that peer. At that point we'll know whether it
will ever relay transactions. We only initialize the m_tx_relay
data structure if:

  • this isn't an outbound block-relay-only connection; AND
  • fRelay=true OR we're offering NODE_BLOOM to this peer (NODE_BLOOM means that the peer may turn on tx relay later)

This concludes backport of core#22778

Depends on D14739

Test Plan

ninja all check-all

Diff Detail

rABC Bitcoin ABC
Lint Not Applicable
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Mon, Nov 6, 08:41
Fabien added a subscriber: Fabien.
Fabien added inline comments.
2063 ↗(On Diff #42955)

That should work the same (please double check)

2750 ↗(On Diff #42955)


5921 ↗(On Diff #42955)


This revision is now accepted and ready to land.Mon, Nov 6, 12:08

declare tx_relay directly in the if's condition, skip the the init-statement