X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FCommitmentTransaction.cs;fp=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FCommitmentTransaction.cs;h=b3bcf613023e04bee39e8aac5c2516a4e7fdb4c1;hb=8de7213fbf663ff60322896282dad51e8ab2f001;hp=c34c454317eecb39c5b95662090539f6b582953a;hpb=afc50e5d491a11364849383b75a8f939df703bac;p=ldk-java diff --git a/c_sharp/src/org/ldk/structs/CommitmentTransaction.cs b/c_sharp/src/org/ldk/structs/CommitmentTransaction.cs index c34c4543..b3bcf613 100644 --- a/c_sharp/src/org/ldk/structs/CommitmentTransaction.cs +++ b/c_sharp/src/org/ldk/structs/CommitmentTransaction.cs @@ -42,16 +42,18 @@ public class CommitmentTransaction : CommonBase { * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read */ public byte[] write() { - byte[] ret = bindings.CommitmentTransaction_write(this.ptr); + long ret = bindings.CommitmentTransaction_write(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; } /** * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write */ public static Result_CommitmentTransactionDecodeErrorZ read(byte[] ser) { - long ret = bindings.CommitmentTransaction_read(ser); + long ret = bindings.CommitmentTransaction_read(InternalUtils.encodeUint8Array(ser)); GC.KeepAlive(ser); if (ret >= 0 && ret <= 4096) { return null; } Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); @@ -67,6 +69,17 @@ public class CommitmentTransaction : CommonBase { return ret; } + /** + * The per commitment point used by the broadcaster. + */ + public byte[] per_commitment_point() { + long ret = bindings.CommitmentTransaction_per_commitment_point(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + /** * The value to be sent to the broadcaster */