mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-24 14:50:57 +01:00
Check for null InetAddress in PeerAddress c'tor.
This commit is contained in:
parent
1175fe9588
commit
9a0950e578
1 changed files with 2 additions and 1 deletions
|
@ -25,6 +25,7 @@ import java.net.UnknownHostException;
|
|||
|
||||
import static com.google.bitcoin.core.Utils.uint32ToByteStreamLE;
|
||||
import static com.google.bitcoin.core.Utils.uint64ToByteStreamLE;
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
/**
|
||||
* A PeerAddress holds an IP address and port number representing the network location of
|
||||
|
@ -71,7 +72,7 @@ public class PeerAddress extends ChildMessage {
|
|||
* Construct a peer address from a memorized or hardcoded address.
|
||||
*/
|
||||
public PeerAddress(InetAddress addr, int port, int protocolVersion) {
|
||||
this.addr = addr;
|
||||
this.addr = checkNotNull(addr);
|
||||
this.port = port;
|
||||
this.protocolVersion = protocolVersion;
|
||||
this.services = BigInteger.ZERO;
|
||||
|
|
Loading…
Add table
Reference in a new issue