[Java] Update auto-generated bindings to 0.0.115
[ldk-java] / src / main / java / org / ldk / structs / TrustedCommitmentTransaction.java
index b282b7a93b97a8f375ac937e27f98463f08e2445..ae83aef96732a8d147b1e1d852190a6e205f69b3 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;
 
 
@@ -29,6 +30,7 @@ public class TrustedCommitmentTransaction extends CommonBase {
         */
        public byte[] txid() {
                byte[] ret = bindings.TrustedCommitmentTransaction_txid(this.ptr);
+               Reference.reachabilityFence(this);
                return ret;
        }
 
@@ -37,9 +39,10 @@ public class TrustedCommitmentTransaction extends CommonBase {
         */
        public BuiltCommitmentTransaction built_transaction() {
                long ret = bindings.TrustedCommitmentTransaction_built_transaction(this.ptr);
+               Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               BuiltCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new BuiltCommitmentTransaction(null, ret); }
-               ret_hu_conv.ptrs_to.add(this);
+               org.ldk.structs.BuiltCommitmentTransaction ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BuiltCommitmentTransaction(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
@@ -48,23 +51,40 @@ public class TrustedCommitmentTransaction extends CommonBase {
         */
        public TxCreationKeys keys() {
                long ret = bindings.TrustedCommitmentTransaction_keys(this.ptr);
+               Reference.reachabilityFence(this);
                if (ret >= 0 && ret <= 4096) { return null; }
-               TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new TxCreationKeys(null, ret); }
-               ret_hu_conv.ptrs_to.add(this);
+               org.ldk.structs.TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxCreationKeys(null, ret); }
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
                return ret_hu_conv;
        }
 
+       /**
+        * Should anchors be used.
+        */
+       public boolean opt_anchors() {
+               boolean ret = bindings.TrustedCommitmentTransaction_opt_anchors(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
        /**
         * Get a signature for each HTLC which was included in the commitment transaction (ie for
         * which HTLCOutputInCommitment::transaction_output_index.is_some()).
         * 
         * The returned Vec has one entry for each HTLC, and in the same order.
+        * 
+        * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
         */
-       public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, DirectedChannelTransactionParameters channel_parameters) {
-               long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.check_arr_len(htlc_base_key, 32), channel_parameters == null ? 0 : channel_parameters.ptr & ~1);
+       public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, org.ldk.structs.DirectedChannelTransactionParameters channel_parameters, org.ldk.structs.EntropySource entropy_source) {
+               long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.check_arr_len(htlc_base_key, 32), channel_parameters == null ? 0 : channel_parameters.ptr, entropy_source == null ? 0 : entropy_source.ptr);
+               Reference.reachabilityFence(this);
+               Reference.reachabilityFence(htlc_base_key);
+               Reference.reachabilityFence(channel_parameters);
+               Reference.reachabilityFence(entropy_source);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);
-               this.ptrs_to.add(channel_parameters);
+               if (this != null) { this.ptrs_to.add(channel_parameters); };
+               if (this != null) { this.ptrs_to.add(entropy_source); };
                return ret_hu_conv;
        }