Class AddressV2Message

  • All Implemented Interfaces:
    Message

    public class AddressV2Message
    extends AddressMessage
    Represents an "addrv2" message on the P2P network, which contains broadcast addresses of other peers. This is one of the ways peers can find each other without using the PeerDiscovery mechanism.

    See BIP155 for details.

    Instances of this class are not safe for use by multiple threads.

    • Method Detail

      • read

        public static AddressV2Message read​(java.nio.ByteBuffer payload)
                                     throws java.nio.BufferUnderflowException,
                                            ProtocolException
        Deserialize this message from a given payload.
        Parameters:
        payload - payload to deserialize from
        Returns:
        read message
        Throws:
        java.nio.BufferUnderflowException - if the read message extends beyond the remaining bytes of the payload
        ProtocolException
      • bitcoinSerializeToStream

        protected void bitcoinSerializeToStream​(java.io.OutputStream stream)
                                         throws java.io.IOException
        Description copied from class: BaseMessage
        Serializes this message to the provided stream. If you just want the raw bytes use bitcoinSerialize().
        Specified by:
        bitcoinSerializeToStream in class BaseMessage
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object