Use a 64-bit nonce in ping
Former code sent '0' as nonce, which was serialized as 32-bit.
This commit is contained in:
parent
d59bce21e5
commit
c971112dfa
1 changed files with 2 additions and 1 deletions
|
@ -3013,8 +3013,9 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
|
||||||
// Keep-alive ping. We send a nonce of zero because we don't use it anywhere
|
// Keep-alive ping. We send a nonce of zero because we don't use it anywhere
|
||||||
// right now.
|
// right now.
|
||||||
if (pto->nLastSend && GetTime() - pto->nLastSend > 30 * 60 && pto->vSend.empty()) {
|
if (pto->nLastSend && GetTime() - pto->nLastSend > 30 * 60 && pto->vSend.empty()) {
|
||||||
|
uint64 nonce = 0;
|
||||||
if (pto->nVersion > BIP0031_VERSION)
|
if (pto->nVersion > BIP0031_VERSION)
|
||||||
pto->PushMessage("ping", 0);
|
pto->PushMessage("ping", nonce);
|
||||||
else
|
else
|
||||||
pto->PushMessage("ping");
|
pto->PushMessage("ping");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue