X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FClosingTransaction.cs;h=c6f33357a745bfae795668507728c548b7e0926a;hb=8de7213fbf663ff60322896282dad51e8ab2f001;hp=37edba0c335ab8b77bd4a976ea4906c59db20f96;hpb=afc50e5d491a11364849383b75a8f939df703bac;p=ldk-java diff --git a/c_sharp/src/org/ldk/structs/ClosingTransaction.cs b/c_sharp/src/org/ldk/structs/ClosingTransaction.cs index 37edba0c..c6f33357 100644 --- a/c_sharp/src/org/ldk/structs/ClosingTransaction.cs +++ b/c_sharp/src/org/ldk/structs/ClosingTransaction.cs @@ -70,7 +70,7 @@ public class ClosingTransaction : CommonBase { * Construct an object of the class */ public static ClosingTransaction of(long to_holder_value_sat, long to_counterparty_value_sat, byte[] to_holder_script, byte[] to_counterparty_script, org.ldk.structs.OutPoint funding_outpoint) { - long ret = bindings.ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script, to_counterparty_script, funding_outpoint == null ? 0 : funding_outpoint.ptr); + long ret = bindings.ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, InternalUtils.encodeUint8Array(to_holder_script), InternalUtils.encodeUint8Array(to_counterparty_script), funding_outpoint == null ? 0 : funding_outpoint.ptr); GC.KeepAlive(to_holder_value_sat); GC.KeepAlive(to_counterparty_value_sat); GC.KeepAlive(to_holder_script); @@ -140,18 +140,22 @@ public class ClosingTransaction : CommonBase { * The destination of the holder's output */ public byte[] to_holder_script() { - byte[] ret = bindings.ClosingTransaction_to_holder_script(this.ptr); + long ret = bindings.ClosingTransaction_to_holder_script(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; } /** * The destination of the counterparty's output */ public byte[] to_counterparty_script() { - byte[] ret = bindings.ClosingTransaction_to_counterparty_script(this.ptr); + long ret = bindings.ClosingTransaction_to_counterparty_script(this.ptr); GC.KeepAlive(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; } }