Package org.ldk.structs
Class Init
- java.lang.Object
-
- org.ldk.structs.Init
-
public class Init extends Object
An [`init`] message to be sent to or received from a peer. [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Init
clone()
Creates a copy of the Initboolean
eq(Init b)
Checks if two Inits contain equal inner contents.boolean
equals(Object o)
protected void
finalize()
InitFeatures
get_features()
The relevant features which the sender supports.Option_NetAddressZ
get_remote_network_address()
The receipient's network address.static Init
of(InitFeatures features_arg, Option_NetAddressZ remote_network_address_arg)
Constructs a new Init given each fieldstatic Result_InitDecodeErrorZ
read(byte[] ser)
Read a Init from a byte array, created by Init_writevoid
set_features(InitFeatures val)
The relevant features which the sender supports.void
set_remote_network_address(Option_NetAddressZ val)
The receipient's network address.byte[]
write()
Serialize the Init object into a byte array which can be read by Init_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
get_features
public InitFeatures get_features()
The relevant features which the sender supports.
-
set_features
public void set_features(InitFeatures val)
The relevant features which the sender supports.
-
get_remote_network_address
public Option_NetAddressZ get_remote_network_address()
The receipient's network address. This adds the option to report a remote IP address back to a connecting peer using the init message. A node can decide to use that information to discover a potential update to its public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing the new address.
-
set_remote_network_address
public void set_remote_network_address(Option_NetAddressZ val)
The receipient's network address. This adds the option to report a remote IP address back to a connecting peer using the init message. A node can decide to use that information to discover a potential update to its public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing the new address.
-
of
public static Init of(InitFeatures features_arg, Option_NetAddressZ remote_network_address_arg)
Constructs a new Init given each field
-
eq
public boolean eq(Init b)
Checks if two Inits contain equal inner contents. This ignores pointers and is_owned flags and looks at the values in fields. Two objects with NULL inner values will be considered "equal" here.
-
write
public byte[] write()
Serialize the Init object into a byte array which can be read by Init_read
-
read
public static Result_InitDecodeErrorZ read(byte[] ser)
Read a Init from a byte array, created by Init_write
-
-