mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-18 21:32:35 +01:00
VersionMessage: deprecate isPingPongSupported()
and ProtocolVersion.PONG
Our minimum version is at 70000 already.
This commit is contained in:
parent
fccb164c90
commit
6133dccc21
@ -554,6 +554,7 @@ public abstract class NetworkParameters {
|
||||
|
||||
public static enum ProtocolVersion {
|
||||
MINIMUM(70000),
|
||||
@Deprecated
|
||||
PONG(60001),
|
||||
BLOOM_FILTER(70001), // BIP37
|
||||
BLOOM_FILTER_BIP111(70011), // BIP111
|
||||
|
@ -1545,8 +1545,6 @@ public class Peer extends PeerSocketHandler {
|
||||
|
||||
protected CompletableFuture<Duration> sendPing(long nonce) {
|
||||
final VersionMessage ver = vPeerVersionMessage;
|
||||
if (!ver.isPingPongSupported())
|
||||
return FutureUtils.failedFuture(new ProtocolException("Peer version is too low for measurable pings: " + ver));
|
||||
if (pendingPings.size() > PENDING_PINGS_LIMIT) {
|
||||
log.info("{}: Too many pending pings, disconnecting", this);
|
||||
close();
|
||||
|
@ -1691,8 +1691,6 @@ public class PeerGroup implements TransactionBroadcaster {
|
||||
return; // Disabled.
|
||||
}
|
||||
for (Peer peer : getConnectedPeers()) {
|
||||
if (peer.getPeerVersionMessage().clientVersion < params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.PONG))
|
||||
continue;
|
||||
peer.sendPing();
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
|
@ -243,12 +243,10 @@ public class VersionMessage extends Message {
|
||||
throw new IllegalArgumentException("name contains invalid characters");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the clientVersion field is {@link NetworkParameters.ProtocolVersion#PONG} or higher.
|
||||
* If it is then {@link Peer#sendPing()} is usable.
|
||||
*/
|
||||
/** @deprecated just assume {@link Ping} and {@link Pong} are supported */
|
||||
@Deprecated
|
||||
public boolean isPingPongSupported() {
|
||||
return clientVersion >= params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.PONG);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user