/** * Constructs a peer address from a stringified hostname+port. Use this if you want to connect to a Tor .onion address. */ public PeerAddress(NetworkParameters params, String hostname, int port) { super(params); this.hostname = hostname; this.port = port; this.protocolVersion = params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.CURRENT); this.services = BigInteger.ZERO; }
/** * Constructs a peer address from the given IP address and port. Version number is default for the given parameters. */ public PeerAddress(NetworkParameters params, InetAddress addr, int port) { this(params, addr, port, params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.CURRENT), BigInteger.ZERO); }
protected Message(NetworkParameters params, byte[] payload, int offset, MessageSerializer serializer, int length) throws ProtocolException { this(params, payload, offset, params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.CURRENT), serializer, length); }
/** * Returns true if the clientVersion field is >= Pong.MIN_PROTOCOL_VERSION. If it is then ping() is usable. */ public boolean isPingPongSupported() { return clientVersion >= params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.PONG); }
/** * Returns true if the clientVersion field is >= FilteredBlock.MIN_PROTOCOL_VERSION. If it is then Bloom filtering * is available and the memory pool of the remote peer will be queried when the downloadData property is true. */ public boolean isBloomFilteringSupported() { return clientVersion >= params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.BLOOM_FILTER); }
/** * Constructs a peer address from the given IP address and port. */ public PeerAddress(NetworkParameters params, InetAddress addr, int port) { this(addr, port, params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.CURRENT)); }
/** * Returns true if the clientVersion field is >= FilteredBlock.MIN_PROTOCOL_VERSION. If it is then Bloom filtering * is available and the memory pool of the remote peer will be queried when the downloadData property is true. */ public boolean isBloomFilteringSupported() { return clientVersion >= params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.BLOOM_FILTER); }
/** * Constructs a peer address from a stringified hostname+port. Use this if you want to connect to a Tor .onion address. */ public PeerAddress(NetworkParameters params, String hostname, int port) { super(params); this.hostname = hostname; this.port = port; this.protocolVersion = params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.CURRENT); this.services = BigInteger.ZERO; }
/** * Returns true if the clientVersion field is >= Pong.MIN_PROTOCOL_VERSION. If it is then ping() is usable. */ public boolean isPingPongSupported() { return clientVersion >= params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.PONG); }
/** * Constructs a peer address from the given IP address and port. Version number is default for the given parameters. */ public PeerAddress(NetworkParameters params, InetAddress addr, int port) { this(params, addr, port, params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.CURRENT), BigInteger.ZERO); }
/** * Constructs a peer address from a stringified hostname+port. Use this if you want to connect to a Tor .onion address. */ public PeerAddress(NetworkParameters params, String hostname, int port) { super(params); this.hostname = hostname; this.port = port; this.protocolVersion = params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.CURRENT); this.services = BigInteger.ZERO; }
/** * Returns true if the clientVersion field is >= Pong.MIN_PROTOCOL_VERSION. If it is then ping() is usable. */ public boolean isPingPongSupported() { return clientVersion >= params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.PONG); }
/** * Returns true if the clientVersion field is >= Pong.MIN_PROTOCOL_VERSION. If it is then ping() is usable. */ public boolean isPingPongSupported() { return clientVersion >= params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.PONG); }
/** * Constructs a peer address from the given IP address and port. */ public PeerAddress(NetworkParameters params, InetAddress addr, int port) { this(addr, port, params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.CURRENT)); }
/** * Constructs a peer address from a stringified hostname+port. Use this if you want to connect to a Tor .onion address. */ public PeerAddress(NetworkParameters params, String hostname, int port) { super(params); this.hostname = hostname; this.port = port; this.protocolVersion = params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.CURRENT); this.services = BigInteger.ZERO; }
/** * Returns true if the clientVersion field is >= FilteredBlock.MIN_PROTOCOL_VERSION. If it is then Bloom filtering * is available and the memory pool of the remote peer will be queried when the downloadData property is true. */ public boolean isBloomFilteringSupported() { return clientVersion >= params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.BLOOM_FILTER); }
/** * Returns true if the clientVersion field is >= FilteredBlock.MIN_PROTOCOL_VERSION. If it is then Bloom filtering * is available and the memory pool of the remote peer will be queried when the downloadData property is true. */ public boolean isBloomFilteringSupported() { return clientVersion >= params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.BLOOM_FILTER); }
public Transaction(NetworkParameters params) { super(params); version = 1; inputs = new ArrayList<>(); outputs = new ArrayList<>(); witnesses = new ArrayList<>(); // We don't initialize appearsIn deliberately as it's only useful for transactions stored in the wallet. length = 8; // 8 for std fields protocolVersion = params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.CURRENT); }
public EmptyMessage(NetworkParameters params, byte[] payload, int offset) throws ProtocolException { super(params, payload, offset, params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.CURRENT), params.getDefaultSerializer(), payload.length); }
@Override protected void bitcoinSerializeToStream(OutputStream stream) throws IOException { // Version, for some reason. Utils.uint32ToByteStreamLE(params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.CURRENT), stream); // Then a vector of block hashes. This is actually a "block locator", a set of block // identifiers that spans the entire chain with exponentially increasing gaps between // them, until we end up at the genesis block. See CBlockLocator::Set() stream.write(new VarInt(locator.size()).encode()); for (Sha256Hash hash : locator) { // Have to reverse as wire format is little endian. stream.write(hash.getReversedBytes()); } // Next, a block ID to stop at. stream.write(stopHash.getReversedBytes()); }