changeset 2812:20aca1dafc3b draft

Use a 64-bit nonce in ping Former code sent '0' as nonce, which was serialized as 32-bit.
author Pieter Wuille <pieter.wuille@gmail.com>
date Thu, 14 Jun 2012 18:31:08 +0200
parents 6eafb872571b
children 9da1393a33e3
files src/main.cpp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2898,8 +2898,9 @@
         // 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");
         }