Package org.bitcoinj.core
Class AddressMessage
java.lang.Object
org.bitcoinj.core.BaseMessage
org.bitcoinj.core.AddressMessage
- All Implemented Interfaces:
Message
- Direct Known Subclasses:
AddressV1Message
,AddressV2Message
Abstract superclass for address messages on the P2P network, which contain network addresses of other peers. This is
one of the ways peers can find each other without using the
PeerDiscovery
mechanism.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
addAddress
(PeerAddress address) protected static List<PeerAddress>
readAddresses
(ByteBuffer payload, int protocolVariant) void
removeAddress
(int index) Methods inherited from class org.bitcoinj.core.BaseMessage
bitcoinSerializeToStream, messageSize, serialize
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.bitcoinj.core.Message
bitcoinSerialize, getMessageSize, unsafeBitcoinSerialize
-
Field Details
-
MAX_ADDRESSES
protected static final long MAX_ADDRESSES- See Also:
-
addresses
-
-
Constructor Details
-
AddressMessage
-
-
Method Details
-
readAddresses
protected static List<PeerAddress> readAddresses(ByteBuffer payload, int protocolVariant) throws BufferUnderflowException, ProtocolException -
addAddress
-
removeAddress
public void removeAddress(int index) -
getAddresses
- Returns:
- An unmodifiableList view of the backing List of addresses. Addresses contained within the list may be safely modified.
-