aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2020-12-14 15:51:26 +0100
committerJon Atack <jon@atack.com>2021-02-02 14:49:06 +0100
commite1e67148321cff0de9eb5e63d2604f05c12e69d1 (patch)
treeabe6bff4daae8709ab4ce00595aabc2b7876b684 /src/net_processing.cpp
parent384e090f9345c07fa81ccafa8cd36037f3cd0813 (diff)
doc: refer to BIPs 339/155 in feature negotiation
and add fSuccessfullyConnected doxygen documentation to clarify that it is set to true on VERACK
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 2dffbd7620..a246c8fa1c 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -2745,12 +2745,11 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
return;
}
- // Feature negotiation of wtxidrelay must happen between VERSION and VERACK
- // to avoid relay problems from switching after a connection is up.
+ // BIP339 defines feature negotiation of wtxidrelay, which must happen between
+ // VERSION and VERACK to avoid relay problems from switching after a connection is up.
if (msg_type == NetMsgType::WTXIDRELAY) {
if (pfrom.fSuccessfullyConnected) {
- // Disconnect peers that send wtxidrelay message after VERACK; this
- // must be negotiated between VERSION and VERACK.
+ // Disconnect peers that send a wtxidrelay message after VERACK.
LogPrint(BCLog::NET, "wtxidrelay received after verack from peer=%d; disconnecting\n", pfrom.GetId());
pfrom.fDisconnect = true;
return;
@@ -2769,10 +2768,11 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
return;
}
+ // BIP155 defines feature negotiation of addrv2 and sendaddrv2, which must happen
+ // between VERSION and VERACK.
if (msg_type == NetMsgType::SENDADDRV2) {
if (pfrom.fSuccessfullyConnected) {
- // Disconnect peers that send SENDADDRV2 message after VERACK; this
- // must be negotiated between VERSION and VERACK.
+ // Disconnect peers that send a SENDADDRV2 message after VERACK.
LogPrint(BCLog::NET, "sendaddrv2 received after verack from peer=%d; disconnecting\n", pfrom.GetId());
pfrom.fDisconnect = true;
return;