Skip to content

Commit

Permalink
[p2p] Small follow-ups to 21528
Browse files Browse the repository at this point in the history
Summary:
Backport of [[bitcoin/bitcoin#22618 | core#22618]].

Depends on D10933.

Ref T1693.

Test Plan:
  ninja all check-all

Reviewers: #bitcoin_abc, tyler-smith, PiRK

Reviewed By: #bitcoin_abc, tyler-smith, PiRK

Subscribers: tyler-smith

Maniphest Tasks: T1693

Differential Revision: https://reviews.bitcoinabc.org/D10934
  • Loading branch information
amitiuttarwar authored and Fabcien committed Feb 1, 2022
1 parent 23e2e06 commit e4ef397
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions doc/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ This release includes the following features and fixes:
- The node will now limit the rate at which the addresses received via p2p messages are processed.
This can be bypassed if needed by granting the `addr` permission to a peer(see the `-whitelist`
option for details).
- A bitcoind node will no longer gossip addresses to inbound peers by default.
They will become eligible for address gossip after sending an ADDR, ADDRV2,
or GETADDR message.
4 changes: 3 additions & 1 deletion src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5034,7 +5034,9 @@ void PeerManagerImpl::ProcessMessage(
return;
}

SetupAddressRelay(pfrom, *peer);
// Since this must be an inbound connection, SetupAddressRelay will
// never fail.
Assume(SetupAddressRelay(pfrom, *peer));

// Only send one GetAddr response per connection to reduce resource
// waste and discourage addr stamping of INV announcements.
Expand Down
2 changes: 1 addition & 1 deletion test/functional/p2p_addr_relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def relay_tests(self):
# often sent before the GETADDR response.
assert_equal(inbound_peer.num_ipv4_received, 0)

# Send an empty ADDR message to intialize address relay on this
# Send an empty ADDR message to initialize address relay on this
# connection.
inbound_peer.send_and_ping(msg_addr())

Expand Down

0 comments on commit e4ef397

Please sign in to comment.