Skip to content

Commit d74e352

Browse files
committed
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 93566e0 commit d74e352

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
@@ -5086,12 +5086,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
50865086

50875087
if (strCommand == NetMsgType::VERSION)
50885088
{
5089-
// Feeler connections exist only to verify if address is online.
5090-
if (pfrom->fFeeler) {
5091-
assert(pfrom->fInbound == false);
5092-
pfrom->fDisconnect = true;
5093-
}
5094-
50955089
// Each connection can only send one version message
50965090
if (pfrom->nVersion != 0)
50975091
{
@@ -5227,6 +5221,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
52275221
int64_t nTimeOffset = nTime - GetTime();
52285222
pfrom->nTimeOffset = nTimeOffset;
52295223
AddTimeData(pfrom->addr, nTimeOffset);
5224+
5225+
// Feeler connections exist only to verify if address is online.
5226+
if (pfrom->fFeeler) {
5227+
assert(pfrom->fInbound == false);
5228+
pfrom->fDisconnect = true;
5229+
}
52305230
}
52315231

52325232

0 commit comments

Comments
 (0)