Browse Source

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.
0.14
Cory Fields 8 years ago
parent
commit
d74e352e01
  1. 12
      src/main.cpp

12
src/main.cpp

@ -5086,12 +5086,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
if (strCommand == NetMsgType::VERSION) if (strCommand == NetMsgType::VERSION)
{ {
// Feeler connections exist only to verify if address is online.
if (pfrom->fFeeler) {
assert(pfrom->fInbound == false);
pfrom->fDisconnect = true;
}
// Each connection can only send one version message // Each connection can only send one version message
if (pfrom->nVersion != 0) if (pfrom->nVersion != 0)
{ {
@ -5227,6 +5221,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
int64_t nTimeOffset = nTime - GetTime(); int64_t nTimeOffset = nTime - GetTime();
pfrom->nTimeOffset = nTimeOffset; pfrom->nTimeOffset = nTimeOffset;
AddTimeData(pfrom->addr, nTimeOffset); AddTimeData(pfrom->addr, nTimeOffset);
// Feeler connections exist only to verify if address is online.
if (pfrom->fFeeler) {
assert(pfrom->fInbound == false);
pfrom->fDisconnect = true;
}
} }

Loading…
Cancel
Save