bindings.HTLCOutputInCommitment_set_transaction_output_index(this.ptr, val.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(val);
- if (this != null) { this.ptrs_to.add(val); };
}
/**
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.HTLCOutputInCommitment ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, ret); }
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(transaction_output_index_arg); };
return ret_hu_conv;
}
* 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); };
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
*/