X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FHTLCUpdate.java;fp=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FHTLCUpdate.java;h=5951ab2e22a28fd485b1bb8f978a4ac7cd5b92df;hb=1b870a3ffab1c0024411e30102bc6d198300f095;hp=57f94ec2202165b714d91a7712ce81070e476f1c;hpb=246459dcbc3be28c38b4951140a5933f4b3aa024;p=ldk-java diff --git a/src/main/java/org/ldk/structs/HTLCUpdate.java b/src/main/java/org/ldk/structs/HTLCUpdate.java index 57f94ec2..5951ab2e 100644 --- a/src/main/java/org/ldk/structs/HTLCUpdate.java +++ b/src/main/java/org/ldk/structs/HTLCUpdate.java @@ -5,6 +5,14 @@ import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; + +/** + * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on + * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the + * preimage claim backward will lead to loss of funds. + * + * [`chain::Watch`]: ../trait.Watch.html + */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class HTLCUpdate extends CommonBase { HTLCUpdate(Object _dummy, long ptr) { super(ptr); } @@ -14,6 +22,9 @@ public class HTLCUpdate extends CommonBase { if (ptr != 0) { bindings.HTLCUpdate_free(ptr); } } + /** + * Creates a copy of the HTLCUpdate + */ public HTLCUpdate clone() { long ret = bindings.HTLCUpdate_clone(this.ptr); HTLCUpdate ret_hu_conv = new HTLCUpdate(null, ret); @@ -21,11 +32,17 @@ public class HTLCUpdate extends CommonBase { return ret_hu_conv; } + /** + * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read + */ public byte[] write() { byte[] ret = bindings.HTLCUpdate_write(this.ptr); return ret; } + /** + * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write + */ public static Result_HTLCUpdateDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.HTLCUpdate_read(ser); Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret);