Skip to content

Commit 9adfc7f

Browse files
theuniFuzzbawls
authored andcommitted
net: Set feelers to disconnect at the end of the version message
This way we're not relying on messages going out after fDisconnect has been set. This should not cause any real behavioral changes, though feelers should arguably disconnect earlier in the process. That can be addressed in a later functional change.
1 parent f88c06c commit 9adfc7f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5277,12 +5277,6 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR
52775277
}
52785278

52795279
if (strCommand == NetMsgType::VERSION) {
5280-
// Feeler connections exist only to verify if address is online.
5281-
if (pfrom->fFeeler) {
5282-
assert(pfrom->fInbound == false);
5283-
pfrom->fDisconnect = true;
5284-
}
5285-
52865280
// Each connection can only send one version message
52875281
if (pfrom->nVersion != 0) {
52885282
connman.PushMessageWithVersion(pfrom, INIT_PROTO_VERSION, NetMsgType::REJECT, strCommand, REJECT_DUPLICATE, std::string("Duplicate version message"));
@@ -5413,6 +5407,12 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR
54135407
pfrom->fDisconnect = true;
54145408
CheckOffsetDisconnectedPeers(pfrom->addr);
54155409
}
5410+
5411+
// Feeler connections exist only to verify if address is online.
5412+
if (pfrom->fFeeler) {
5413+
assert(pfrom->fInbound == false);
5414+
pfrom->fDisconnect = true;
5415+
}
54165416
}
54175417

54185418

0 commit comments

Comments
 (0)