X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FBuiltCommitmentTransaction.cs;fp=c_sharp%2Fsrc%2Forg%2Fldk%2Fstructs%2FBuiltCommitmentTransaction.cs;h=f5452bee5d4c14baa4ed2c0b6f1cefd0005ce389;hb=c6777737ea14e7814b0fa7d6fe16536f31d4a82b;hp=9dc21c508fd882e1ff2e0623f16bde1c7d7e08dd;hpb=ee72c84d4bf9e2404e02fe20155efb502ceaee1b;p=ldk-java diff --git a/c_sharp/src/org/ldk/structs/BuiltCommitmentTransaction.cs b/c_sharp/src/org/ldk/structs/BuiltCommitmentTransaction.cs index 9dc21c50..f5452bee 100644 --- a/c_sharp/src/org/ldk/structs/BuiltCommitmentTransaction.cs +++ b/c_sharp/src/org/ldk/structs/BuiltCommitmentTransaction.cs @@ -122,11 +122,10 @@ public class BuiltCommitmentTransaction : CommonBase { } /** - * Sign a transaction, either because we are counter-signing the counterparty's transaction or - * because we are about to broadcast a holder transaction. + * Signs the counterparty's commitment transaction. */ - public byte[] sign(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis) { - byte[] ret = bindings.BuiltCommitmentTransaction_sign(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis); + public byte[] sign_counterparty_commitment(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis) { + byte[] ret = bindings.BuiltCommitmentTransaction_sign_counterparty_commitment(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis); GC.KeepAlive(this); GC.KeepAlive(funding_key); GC.KeepAlive(funding_redeemscript); @@ -134,5 +133,19 @@ public class BuiltCommitmentTransaction : CommonBase { return ret; } + /** + * Signs the holder commitment transaction because we are about to broadcast it. + */ + public byte[] sign_holder_commitment(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis, org.ldk.structs.EntropySource entropy_source) { + byte[] ret = bindings.BuiltCommitmentTransaction_sign_holder_commitment(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis, entropy_source.ptr); + GC.KeepAlive(this); + GC.KeepAlive(funding_key); + GC.KeepAlive(funding_redeemscript); + GC.KeepAlive(channel_value_satoshis); + GC.KeepAlive(entropy_source); + if (this != null) { this.ptrs_to.AddLast(entropy_source); }; + return ret; + } + } } } }