diff --git a/core/src/main/java/com/google/bitcoin/core/Peer.java b/core/src/main/java/com/google/bitcoin/core/Peer.java index 759a789e..fba9a230 100644 --- a/core/src/main/java/com/google/bitcoin/core/Peer.java +++ b/core/src/main/java/com/google/bitcoin/core/Peer.java @@ -894,7 +894,7 @@ public class Peer { } if (pingAfterGetData) - sendMessage(new Ping((long) Math.random() * Long.MAX_VALUE)); + sendMessage(new Ping((long) (Math.random() * Long.MAX_VALUE))); } /** @@ -1150,7 +1150,7 @@ public class Peer { * @throws ProtocolException if the peer version is too low to support measurable pings. */ public ListenableFuture ping() throws IOException, ProtocolException { - return ping((long) Math.random() * Long.MAX_VALUE); + return ping((long) (Math.random() * Long.MAX_VALUE)); } protected ListenableFuture ping(long nonce) throws IOException, ProtocolException {