[net_processing] Provide debug error if code assumptions change.

Currently, this call to SetupAddressRelay will never return false because of
the previous guard that returns early if the peer is not an inbound connection.
Rather than implicitly relying on this guarantee, throw an error in the debug
build if it ever changes.
This commit is contained in:
Amiti Uttarwar 2021-08-03 09:26:29 -07:00
parent aa79c91260
commit 9778b0fec1

View File

@ -3744,7 +3744,9 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
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.