]> git.bitcoin.ninja Git - ldk-java/blobdiff - src/main/java/org/ldk/structs/HTLCOutputInCommitment.java
Update CI references to LDK 0.0.124 drop stale memchr pins
[ldk-java] / src / main / java / org / ldk / structs / HTLCOutputInCommitment.java
index a69d03733350c7d88eaa0874909c22f3b20b8991..0f5d72892a5b98c36190bb4cf6b9867fd67f1edc 100644 (file)
@@ -165,7 +165,7 @@ public class HTLCOutputInCommitment extends CommonBase {
         * Two objects with NULL inner values will be considered "equal" here.
         */
        public boolean eq(org.ldk.structs.HTLCOutputInCommitment b) {
-               boolean ret = bindings.HTLCOutputInCommitment_eq(this.ptr, b == null ? 0 : b.ptr);
+               boolean ret = bindings.HTLCOutputInCommitment_eq(this.ptr, b.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(b);
                if (this != null) { this.ptrs_to.add(b); };
@@ -176,6 +176,17 @@ public class HTLCOutputInCommitment extends CommonBase {
                if (!(o instanceof HTLCOutputInCommitment)) return false;
                return this.eq((HTLCOutputInCommitment)o);
        }
+       /**
+        * Converts HTLC's value with millisatoshi precision into [bitcoin::Amount] with satoshi precision.
+        * Typically this conversion is needed when transitioning from LN into base-layer Bitcoin,
+        * e. g. in commitment transactions.
+        */
+       public long to_bitcoin_amount() {
+               long ret = bindings.HTLCOutputInCommitment_to_bitcoin_amount(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
        /**
         * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
         */