Update auto-generated bindings to 0.0.103
[ldk-java] / src / main / java / org / ldk / structs / ChannelHandshakeConfig.java
index 3bab616c0c8c5990e23fcc475dbb8850c2757465..e4b3e944ffe9afbb5e4042e99bc7a647844d03d0 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -44,18 +45,21 @@ public class ChannelHandshakeConfig extends CommonBase {
        }
 
        /**
-        * Set to the amount of time we require our counterparty to wait to claim their money.
+        * Set to the number of blocks we require our counterparty to wait to claim their money (ie
+        * the number of blocks we have to punish our counterparty if they broadcast a revoked
+        * transaction).
         * 
-        * It's one of the main parameter of our security model. We (or one of our watchtowers) MUST
-        * be online to check for peer having broadcast a revoked transaction to steal our funds
-        * at least once every our_to_self_delay blocks.
+        * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
+        * be online to check for revoked transactions on-chain at least once every our_to_self_delay
+        * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
+        * possibly with time in between to RBF the spending transaction).
         * 
         * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
         * case of an honest unilateral channel close, which implicitly decrease the economic value of
         * our channel.
         * 
-        * Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel
-        * opening so you can tweak config to ask for more security, not less.
+        * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
+        * can tweak config to ask for more security, not less.
         */
        public short get_our_to_self_delay() {
                short ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this.ptr);
@@ -63,18 +67,21 @@ public class ChannelHandshakeConfig extends CommonBase {
        }
 
        /**
-        * Set to the amount of time we require our counterparty to wait to claim their money.
+        * Set to the number of blocks we require our counterparty to wait to claim their money (ie
+        * the number of blocks we have to punish our counterparty if they broadcast a revoked
+        * transaction).
         * 
-        * It's one of the main parameter of our security model. We (or one of our watchtowers) MUST
-        * be online to check for peer having broadcast a revoked transaction to steal our funds
-        * at least once every our_to_self_delay blocks.
+        * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
+        * be online to check for revoked transactions on-chain at least once every our_to_self_delay
+        * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
+        * possibly with time in between to RBF the spending transaction).
         * 
         * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
         * case of an honest unilateral channel close, which implicitly decrease the economic value of
         * our channel.
         * 
-        * Default value: BREAKDOWN_TIMEOUT (currently 144), we enforce it as a minimum at channel
-        * opening so you can tweak config to ask for more security, not less.
+        * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
+        * can tweak config to ask for more security, not less.
         */
        public void set_our_to_self_delay(short val) {
                bindings.ChannelHandshakeConfig_set_our_to_self_delay(this.ptr, val);
@@ -110,9 +117,10 @@ public class ChannelHandshakeConfig extends CommonBase {
        /**
         * Constructs a new ChannelHandshakeConfig given each field
         */
-       public static ChannelHandshakeConfig constructor_new(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg) {
+       public static ChannelHandshakeConfig of(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg) {
                long ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg);
-               ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeConfig(null, ret); }
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }
@@ -122,17 +130,19 @@ public class ChannelHandshakeConfig extends CommonBase {
         */
        public ChannelHandshakeConfig clone() {
                long ret = bindings.ChannelHandshakeConfig_clone(this.ptr);
-               ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeConfig(null, ret); }
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
 
        /**
-        * Creates a "default" ChannelHandshakeConfig. See other documentaiton for details on what this implies.
+        * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
         */
-       public static ChannelHandshakeConfig constructor_default() {
+       public static ChannelHandshakeConfig with_default() {
                long ret = bindings.ChannelHandshakeConfig_default();
-               ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeConfig(null, ret); }
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }