mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-15 03:35:52 +00:00
Fix a bug that would cause ping nonces to always be set to zero, thus screwing up perceived ping times.
This commit is contained in:
parent
4d01e107fa
commit
fb9bfb960e
@ -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<Long> ping() throws IOException, ProtocolException {
|
||||
return ping((long) Math.random() * Long.MAX_VALUE);
|
||||
return ping((long) (Math.random() * Long.MAX_VALUE));
|
||||
}
|
||||
|
||||
protected ListenableFuture<Long> ping(long nonce) throws IOException, ProtocolException {
|
||||
|
Loading…
x
Reference in New Issue
Block a user