mirror of https://github.com/bitcoin/bitcoin
Merge #19763: net: don't try to relay to the address' originator
pull/20651/head7fabe0f359
net: don't relay to the address' originator (Vasil Dimov) Pull request description: 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. ACKs for top commit: sdaftuar: ACK7fabe0f359
(this time I looked at the test, and verified the test breaks in expected ways if I break the code). jnewbery: utACK7fabe0f359
(only net_processing changes. I haven't reviewed the test changes) jonatack: re-ACK7fabe0f359
per `git range-diffb76abae
fd897f8 7fabe0f`, change since last review is rebase and more readable Doxygen documentation Tree-SHA512: c6a9d11c7afc97ab4e8960513f6416648d4a8c0c64b713c145a7482a7b9e54946f81386a3351e3ec0011e5594ba5ccff4d10c6f656bb80680d9f0d0a63366165
commit
b103fdcb3b
Loading…
Reference in new issue