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.
This commit is contained in:
parent
93566e0c37
commit
d74e352e01
1 changed files with 6 additions and 6 deletions
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)
|
||||
{
|
||||
// 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
|
||||
if (pfrom->nVersion != 0)
|
||||
{
|
||||
|
@ -5227,6 +5221,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
|||
int64_t nTimeOffset = nTime - GetTime();
|
||||
pfrom->nTimeOffset = 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…
Reference in a new issue