]> git.bitcoin.ninja Git - ldk-java/blobdiff - src/main/java/org/ldk/structs/Init.java
Update CI references to LDK 0.0.124 drop stale memchr pins
[ldk-java] / src / main / java / org / ldk / structs / Init.java
index 8b0122395437448924633fe2a1f531d95eed8109..66d76105221c9fab5b538f63a6fbb62f52a93177 100644 (file)
@@ -38,10 +38,36 @@ public class Init extends CommonBase {
         * The relevant features which the sender supports.
         */
        public void set_features(org.ldk.structs.InitFeatures val) {
-               bindings.Init_set_features(this.ptr, val == null ? 0 : val.ptr);
+               bindings.Init_set_features(this.ptr, val.ptr);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
+       }
+
+       /**
+        * 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_ThirtyTwoBytesZZ 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_ThirtyTwoBytesZZ ret_hu_conv = org.ldk.structs.Option_CVec_ThirtyTwoBytesZZ.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_ThirtyTwoBytesZZ val) {
+               bindings.Init_set_networks(this.ptr, val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
-               if (this != null) { this.ptrs_to.add(val); };
        }
 
        /**
@@ -52,11 +78,11 @@ public class Init extends CommonBase {
         * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
         * the new address.
         */
-       public Option_NetAddressZ get_remote_network_address() {
+       public Option_SocketAddressZ get_remote_network_address() {
                long ret = bindings.Init_get_remote_network_address(this.ptr);
                Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               org.ldk.structs.Option_NetAddressZ ret_hu_conv = org.ldk.structs.Option_NetAddressZ.constr_from_ptr(ret);
+               org.ldk.structs.Option_SocketAddressZ ret_hu_conv = org.ldk.structs.Option_SocketAddressZ.constr_from_ptr(ret);
                if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
@@ -69,25 +95,23 @@ public class Init extends CommonBase {
         * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
         * the new address.
         */
-       public void set_remote_network_address(org.ldk.structs.Option_NetAddressZ val) {
+       public void set_remote_network_address(org.ldk.structs.Option_SocketAddressZ 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(org.ldk.structs.InitFeatures features_arg, org.ldk.structs.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_ThirtyTwoBytesZZ networks_arg, org.ldk.structs.Option_SocketAddressZ remote_network_address_arg) {
+               long ret = bindings.Init_new(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(remote_network_address_arg); };
                return ret_hu_conv;
        }
 
@@ -109,13 +133,25 @@ public class Init extends CommonBase {
                return ret_hu_conv;
        }
 
+       /**
+        * Generates a non-cryptographic 64-bit hash of the Init.
+        */
+       public long hash() {
+               long ret = bindings.Init_hash(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
+       @Override public int hashCode() {
+               return (int)this.hash();
+       }
        /**
         * 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.
         */
        public boolean eq(org.ldk.structs.Init b) {
-               boolean ret = bindings.Init_eq(this.ptr, b == null ? 0 : b.ptr);
+               boolean ret = bindings.Init_eq(this.ptr, b.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(b);
                if (this != null) { this.ptrs_to.add(b); };