Update auto-updated Java files
[ldk-java] / src / main / java / org / ldk / structs / ChainParameters.java
index 48f54722ae88aab10ab72eac28ed3825a88ad578..72aafcf451837eabbaac9aa8956f4d86cc3a90d4 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import java.lang.ref.Reference;
 import javax.annotation.Nullable;
 
 
@@ -28,6 +29,7 @@ public class ChainParameters extends CommonBase {
         */
        public Network get_network() {
                Network ret = bindings.ChainParameters_get_network(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -36,6 +38,8 @@ public class ChainParameters extends CommonBase {
         */
        public void set_network(org.ldk.enums.Network val) {
                bindings.ChainParameters_set_network(this.ptr, val);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
@@ -45,8 +49,9 @@ public class ChainParameters extends CommonBase {
         */
        public BestBlock get_best_block() {
                long ret = bindings.ChainParameters_get_best_block(this.ptr);
-               if (ret >= 0 && ret < 1024) { return null; }
-               BestBlock ret_hu_conv = new BestBlock(null, ret);
+               Reference.reachabilityFence(this);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BestBlock(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
@@ -58,6 +63,8 @@ public class ChainParameters extends CommonBase {
         */
        public void set_best_block(BestBlock val) {
                bindings.ChainParameters_set_best_block(this.ptr, val == null ? 0 : val.ptr & ~1);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
@@ -65,19 +72,28 @@ public class ChainParameters extends CommonBase {
         */
        public static ChainParameters of(org.ldk.enums.Network network_arg, BestBlock best_block_arg) {
                long ret = bindings.ChainParameters_new(network_arg, best_block_arg == null ? 0 : best_block_arg.ptr & ~1);
-               if (ret >= 0 && ret < 1024) { return null; }
-               ChainParameters ret_hu_conv = new ChainParameters(null, ret);
+               Reference.reachabilityFence(network_arg);
+               Reference.reachabilityFence(best_block_arg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               ChainParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChainParameters(null, ret); }
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }
 
+       long clone_ptr() {
+               long ret = bindings.ChainParameters_clone_ptr(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
        /**
         * Creates a copy of the ChainParameters
         */
        public ChainParameters clone() {
                long ret = bindings.ChainParameters_clone(this.ptr);
-               if (ret >= 0 && ret < 1024) { return null; }
-               ChainParameters ret_hu_conv = new ChainParameters(null, ret);
+               Reference.reachabilityFence(this);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               ChainParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChainParameters(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }