mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-04 06:12:07 +01:00
Use a 64-bit nonce in ping
Former code sent '0' as nonce, which was serialized as 32-bit.
This commit is contained in:
committed by
Luke Dashjr
parent
01ed45cbbc
commit
8f0c0c16d3
@@ -2886,8 +2886,9 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
|
||||
// Keep-alive ping. We send a nonce of zero because we don't use it anywhere
|
||||
// right now.
|
||||
if (pto->nLastSend && GetTime() - pto->nLastSend > 30 * 60 && pto->vSend.empty()) {
|
||||
uint64 nonce = 0;
|
||||
if (pto->nVersion > BIP0031_VERSION)
|
||||
pto->PushMessage("ping", 0);
|
||||
pto->PushMessage("ping", nonce);
|
||||
else
|
||||
pto->PushMessage("ping");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user