[Java] Update auto-generated Java bindings
[ldk-java] / src / main / java / org / ldk / structs / ChannelHandshakeLimits.java
index 93bb3a1fdac19ac34778b03be169b94fd105e2fe..6f9f5443cfc9a67f08b1fb520e9255e60272c1f6 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;
 
 
@@ -12,7 +13,7 @@ import javax.annotation.Nullable;
  * 
  * These limits are only applied to our counterparty's limits, not our own.
  * 
- * Use 0/<type>::max_value() as appropriate to skip checking.
+ * Use 0/`<type>::max_value()` as appropriate to skip checking.
  * 
  * Provides sane defaults for most configurations.
  * 
@@ -30,24 +31,51 @@ public class ChannelHandshakeLimits extends CommonBase {
        }
 
        /**
-        * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
+        * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
         * only applies to inbound channels.
         * 
         * Default value: 0.
         */
        public long get_min_funding_satoshis() {
                long ret = bindings.ChannelHandshakeLimits_get_min_funding_satoshis(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
        /**
-        * Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
+        * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
         * only applies to inbound channels.
         * 
         * Default value: 0.
         */
        public void set_min_funding_satoshis(long val) {
                bindings.ChannelHandshakeLimits_set_min_funding_satoshis(this.ptr, val);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
+       }
+
+       /**
+        * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
+        * only applies to inbound channels.
+        * 
+        * Default value: 2^24 - 1.
+        */
+       public long get_max_funding_satoshis() {
+               long ret = bindings.ChannelHandshakeLimits_get_max_funding_satoshis(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
+       /**
+        * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
+        * only applies to inbound channels.
+        * 
+        * Default value: 2^24 - 1.
+        */
+       public void set_max_funding_satoshis(long val) {
+               bindings.ChannelHandshakeLimits_set_max_funding_satoshis(this.ptr, val);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
@@ -58,6 +86,7 @@ public class ChannelHandshakeLimits extends CommonBase {
         */
        public long get_max_htlc_minimum_msat() {
                long ret = bindings.ChannelHandshakeLimits_get_max_htlc_minimum_msat(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -69,6 +98,8 @@ public class ChannelHandshakeLimits extends CommonBase {
         */
        public void set_max_htlc_minimum_msat(long val) {
                bindings.ChannelHandshakeLimits_set_max_htlc_minimum_msat(this.ptr, val);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
@@ -79,6 +110,7 @@ public class ChannelHandshakeLimits extends CommonBase {
         */
        public long get_min_max_htlc_value_in_flight_msat() {
                long ret = bindings.ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -90,6 +122,8 @@ public class ChannelHandshakeLimits extends CommonBase {
         */
        public void set_min_max_htlc_value_in_flight_msat(long val) {
                bindings.ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this.ptr, val);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
@@ -101,6 +135,7 @@ public class ChannelHandshakeLimits extends CommonBase {
         */
        public long get_max_channel_reserve_satoshis() {
                long ret = bindings.ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -113,6 +148,8 @@ public class ChannelHandshakeLimits extends CommonBase {
         */
        public void set_max_channel_reserve_satoshis(long val) {
                bindings.ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this.ptr, val);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
@@ -123,6 +160,7 @@ public class ChannelHandshakeLimits extends CommonBase {
         */
        public short get_min_max_accepted_htlcs() {
                short ret = bindings.ChannelHandshakeLimits_get_min_max_accepted_htlcs(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -134,6 +172,8 @@ public class ChannelHandshakeLimits extends CommonBase {
         */
        public void set_min_max_accepted_htlcs(short val) {
                bindings.ChannelHandshakeLimits_set_min_max_accepted_htlcs(this.ptr, val);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
@@ -146,6 +186,7 @@ public class ChannelHandshakeLimits extends CommonBase {
         */
        public int get_max_minimum_depth() {
                int ret = bindings.ChannelHandshakeLimits_get_max_minimum_depth(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -159,35 +200,90 @@ public class ChannelHandshakeLimits extends CommonBase {
         */
        public void set_max_minimum_depth(int val) {
                bindings.ChannelHandshakeLimits_set_max_minimum_depth(this.ptr, val);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
+       }
+
+       /**
+        * Whether we implicitly trust funding transactions generated by us for our own outbound
+        * channels to not be double-spent.
+        * 
+        * If this is set, we assume that our own funding transactions are *never* double-spent, and
+        * thus we can trust them without any confirmations. This is generally a reasonable
+        * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
+        * control of the signing keys).
+        * 
+        * You may wish to un-set this if you allow the user to (or do in an automated fashion)
+        * double-spend the funding transaction to RBF with an alternative channel open.
+        * 
+        * This only applies if our counterparty set their confirmations-required value to 0, and we
+        * always trust our own funding transaction at 1 confirmation irrespective of this value.
+        * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
+        * `true` (0) and `false` (1).
+        * 
+        * Default value: true
+        */
+       public boolean get_trust_own_funding_0conf() {
+               boolean ret = bindings.ChannelHandshakeLimits_get_trust_own_funding_0conf(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
+       /**
+        * Whether we implicitly trust funding transactions generated by us for our own outbound
+        * channels to not be double-spent.
+        * 
+        * If this is set, we assume that our own funding transactions are *never* double-spent, and
+        * thus we can trust them without any confirmations. This is generally a reasonable
+        * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
+        * control of the signing keys).
+        * 
+        * You may wish to un-set this if you allow the user to (or do in an automated fashion)
+        * double-spend the funding transaction to RBF with an alternative channel open.
+        * 
+        * This only applies if our counterparty set their confirmations-required value to 0, and we
+        * always trust our own funding transaction at 1 confirmation irrespective of this value.
+        * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
+        * `true` (0) and `false` (1).
+        * 
+        * Default value: true
+        */
+       public void set_trust_own_funding_0conf(boolean val) {
+               bindings.ChannelHandshakeLimits_set_trust_own_funding_0conf(this.ptr, val);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
         * Set to force an incoming channel to match our announced channel preference in
-        * [`ChannelConfig::announced_channel`].
+        * [`ChannelHandshakeConfig::announced_channel`].
         * 
         * For a node which is not online reliably, this should be set to true and
-        * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
+        * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
         * channels will ever be opened.
         * 
         * Default value: true.
         */
        public boolean get_force_announced_channel_preference() {
                boolean ret = bindings.ChannelHandshakeLimits_get_force_announced_channel_preference(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
        /**
         * Set to force an incoming channel to match our announced channel preference in
-        * [`ChannelConfig::announced_channel`].
+        * [`ChannelHandshakeConfig::announced_channel`].
         * 
         * For a node which is not online reliably, this should be set to true and
-        * [`ChannelConfig::announced_channel`] set to false, ensuring that no announced (aka public)
+        * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
         * channels will ever be opened.
         * 
         * Default value: true.
         */
        public void set_force_announced_channel_preference(boolean val) {
                bindings.ChannelHandshakeLimits_set_force_announced_channel_preference(this.ptr, val);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
@@ -201,6 +297,7 @@ public class ChannelHandshakeLimits extends CommonBase {
         */
        public short get_their_to_self_delay() {
                short ret = bindings.ChannelHandshakeLimits_get_their_to_self_delay(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -215,27 +312,46 @@ public class ChannelHandshakeLimits extends CommonBase {
         */
        public void set_their_to_self_delay(short val) {
                bindings.ChannelHandshakeLimits_set_their_to_self_delay(this.ptr, val);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(val);
        }
 
        /**
         * Constructs a new ChannelHandshakeLimits given each field
         */
-       public static ChannelHandshakeLimits of(long min_funding_satoshis_arg, long max_htlc_minimum_msat_arg, long min_max_htlc_value_in_flight_msat_arg, long max_channel_reserve_satoshis_arg, short min_max_accepted_htlcs_arg, int max_minimum_depth_arg, boolean force_announced_channel_preference_arg, short their_to_self_delay_arg) {
-               long ret = bindings.ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, force_announced_channel_preference_arg, their_to_self_delay_arg);
-               if (ret < 1024) { return null; }
-               ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+       public static ChannelHandshakeLimits of(long min_funding_satoshis_arg, long max_funding_satoshis_arg, long max_htlc_minimum_msat_arg, long min_max_htlc_value_in_flight_msat_arg, long max_channel_reserve_satoshis_arg, short min_max_accepted_htlcs_arg, int max_minimum_depth_arg, boolean trust_own_funding_0conf_arg, boolean force_announced_channel_preference_arg, short their_to_self_delay_arg) {
+               long ret = bindings.ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, trust_own_funding_0conf_arg, force_announced_channel_preference_arg, their_to_self_delay_arg);
+               Reference.reachabilityFence(min_funding_satoshis_arg);
+               Reference.reachabilityFence(max_funding_satoshis_arg);
+               Reference.reachabilityFence(max_htlc_minimum_msat_arg);
+               Reference.reachabilityFence(min_max_htlc_value_in_flight_msat_arg);
+               Reference.reachabilityFence(max_channel_reserve_satoshis_arg);
+               Reference.reachabilityFence(min_max_accepted_htlcs_arg);
+               Reference.reachabilityFence(max_minimum_depth_arg);
+               Reference.reachabilityFence(trust_own_funding_0conf_arg);
+               Reference.reachabilityFence(force_announced_channel_preference_arg);
+               Reference.reachabilityFence(their_to_self_delay_arg);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.ChannelHandshakeLimits ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeLimits(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }
 
+       long clone_ptr() {
+               long ret = bindings.ChannelHandshakeLimits_clone_ptr(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
        /**
         * Creates a copy of the ChannelHandshakeLimits
         */
        public ChannelHandshakeLimits clone() {
                long ret = bindings.ChannelHandshakeLimits_clone(this.ptr);
-               if (ret < 1024) { return null; }
-               ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret);
-               ret_hu_conv.ptrs_to.add(this);
+               Reference.reachabilityFence(this);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.ChannelHandshakeLimits ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeLimits(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
@@ -244,9 +360,9 @@ public class ChannelHandshakeLimits extends CommonBase {
         */
        public static ChannelHandshakeLimits with_default() {
                long ret = bindings.ChannelHandshakeLimits_default();
-               if (ret < 1024) { return null; }
-               ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret);
-               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.ChannelHandshakeLimits ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelHandshakeLimits(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
                return ret_hu_conv;
        }