- public void set_commit_upfront_shutdown_pubkey(ChannelConfig this_ptr, boolean val) {
- bindings.ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr.ptr & ~1, val);
- this.ptrs_to.add(this_ptr);
+ /**
+ * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
+ * supports it, they will then enforce the mutual-close output to us matches what we provided
+ * at intialization, preventing us from closing to an alternate pubkey.
+ *
+ * This is set to true by default to provide a slight increase in security, though ultimately
+ * any attacker who is able to take control of a channel can just as easily send the funds via
+ * lightning payments, so we never require that our counterparties support this option.
+ *
+ * This cannot be changed after a channel has been initialized.
+ *
+ * Default value: true.
+ */
+ public void set_commit_upfront_shutdown_pubkey(boolean val) {
+ bindings.ChannelConfig_set_commit_upfront_shutdown_pubkey(this.ptr, val);
+ }
+
+ /**
+ * Constructs a new ChannelConfig given each field
+ */
+ public static ChannelConfig of(int fee_proportional_millionths_arg, short cltv_expiry_delta_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg) {
+ long ret = bindings.ChannelConfig_new(fee_proportional_millionths_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
+ ChannelConfig ret_hu_conv = new ChannelConfig(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ return ret_hu_conv;