aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorAmiti Uttarwar <amiti@uttarwar.org>2021-08-03 09:26:29 -0700
committerAmiti Uttarwar <amiti@uttarwar.org>2021-08-04 12:36:22 -0700
commit9778b0fec13c047a4c7f3ae425d044da26eadc81 (patch)
tree513563858889dc0c96518809792acae2fcf715d5 /src/net_processing.cpp
parentaa79c912608fdc77c69dd43653aa87f1f34e01dd (diff)
downloadbitcoin-9778b0fec13c047a4c7f3ae425d044da26eadc81.tar.xz
[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.
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 005fe1bf0c..754567420c 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -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.