Page MenuHomePhabricator

net: don't relay to the address' originator
ClosedPublic

Authored by Fabien on Jan 21 2022, 10:52.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Maniphest Tasks
Restricted Maniphest Task
Commits
rABCe10e10c2b39a: net: don't relay to the address' originator
Summary
For each address to be relayed we "randomly" pick 2 nodes to send the address to (in `RelayAddress()`). However we do not take into consideration that it does not make sense to relay the address back to its originator (`CNode::PushAddress()` will do nothing in that case).

This means that if the originator is among the "randomly" picked nodes, then we will relay to one node less than intended.

Fix this by skipping the originating node when choosing candidates to relay to.

Backport of core#19763.

Depends on D10859.

Ref T1696.

Test Plan
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable