X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FInit.java;h=135adca35810b839b0658fc26013736c1a3e4a1c;hb=32973ea2749f8efd05b543dd774763513013b38b;hp=767ecfd36d93adfc9ce579b3ff93218ddb2628c7;hpb=0de4267b2f4dd9a0b2b2dfab7efc788887894a33;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Init.java b/src/main/java/org/ldk/structs/Init.java index 767ecfd3..135adca3 100644 --- a/src/main/java/org/ldk/structs/Init.java +++ b/src/main/java/org/ldk/structs/Init.java @@ -9,7 +9,9 @@ import javax.annotation.Nullable; /** - * An init message to be sent or received from a peer + * 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 */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Init extends CommonBase { @@ -21,7 +23,7 @@ public class Init extends CommonBase { } /** - * The relevant features which the sender supports + * The relevant features which the sender supports. */ public InitFeatures get_features() { long ret = bindings.Init_get_features(this.ptr); @@ -33,9 +35,9 @@ public class Init extends CommonBase { } /** - * The relevant features which the sender supports + * The relevant features which the sender supports. */ - public void set_features(InitFeatures val) { + public void set_features(org.ldk.structs.InitFeatures val) { bindings.Init_set_features(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -43,10 +45,40 @@ public class Init extends CommonBase { } /** - * 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 node_announcement update message containing the new address. + * Indicates chains the sender is interested in. + * + * If there are no common chains, the connection will be closed. + * + * Returns a copy of the field. + */ + public Option_CVec_ChainHashZZ get_networks() { + long ret = bindings.Init_get_networks(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_ChainHashZZ ret_hu_conv = org.ldk.structs.Option_CVec_ChainHashZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Indicates chains the sender is interested in. + * + * If there are no common chains, the connection will be closed. + */ + public void set_networks(org.ldk.structs.Option_CVec_ChainHashZZ val) { + bindings.Init_set_networks(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + if (this != null) { this.ptrs_to.add(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. */ public Option_NetAddressZ get_remote_network_address() { long ret = bindings.Init_get_remote_network_address(this.ptr); @@ -58,28 +90,34 @@ public class Init extends CommonBase { } /** - * 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 node_announcement update message containing the new 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. */ - public void set_remote_network_address(Option_NetAddressZ val) { + public void set_remote_network_address(org.ldk.structs.Option_NetAddressZ val) { bindings.Init_set_remote_network_address(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); + if (this != null) { this.ptrs_to.add(val); }; } /** * Constructs a new Init given each field */ - public static Init of(InitFeatures features_arg, Option_NetAddressZ remote_network_address_arg) { - long ret = bindings.Init_new(features_arg == null ? 0 : features_arg.ptr, remote_network_address_arg.ptr); + public static Init of(org.ldk.structs.InitFeatures features_arg, org.ldk.structs.Option_CVec_ChainHashZZ networks_arg, org.ldk.structs.Option_NetAddressZ remote_network_address_arg) { + long ret = bindings.Init_new(features_arg == null ? 0 : features_arg.ptr, networks_arg.ptr, remote_network_address_arg.ptr); Reference.reachabilityFence(features_arg); + Reference.reachabilityFence(networks_arg); Reference.reachabilityFence(remote_network_address_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Init ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Init(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(features_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(networks_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(remote_network_address_arg); }; return ret_hu_conv; } @@ -106,7 +144,7 @@ public class Init extends CommonBase { * 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. */ - public boolean eq(Init b) { + public boolean eq(org.ldk.structs.Init b) { boolean ret = bindings.Init_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b);