Skip to content

Commit 9778b0f

Browse files
committed
[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.
1 parent aa79c91 commit 9778b0f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/net_processing.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3744,7 +3744,9 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
37443744
return;
37453745
}
37463746

3747-
SetupAddressRelay(pfrom, *peer);
3747+
// Since this must be an inbound connection, SetupAddressRelay will
3748+
// never fail.
3749+
Assume(SetupAddressRelay(pfrom, *peer));
37483750

37493751
// Only send one GetAddr response per connection to reduce resource waste
37503752
// and discourage addr stamping of INV announcements.

0 commit comments

Comments
 (0)