6 namespace org { namespace ldk { namespace structs {
10 * A wrapper on ClosingTransaction indicating that the built bitcoin
11 * transaction is trusted.
13 * See trust() and verify() functions on CommitmentTransaction.
15 * This structure implements Deref.
17 public class TrustedClosingTransaction : CommonBase {
18 internal TrustedClosingTransaction(object _dummy, long ptr) : base(ptr) { }
19 ~TrustedClosingTransaction() {
20 if (ptr != 0) { bindings.TrustedClosingTransaction_free(ptr); }
24 * The pre-built Bitcoin commitment transaction
26 public byte[] built_transaction() {
27 byte[] ret = bindings.TrustedClosingTransaction_built_transaction(this.ptr);
33 * Get the SIGHASH_ALL sighash value of the transaction.
35 * This can be used to verify a signature.
37 public byte[] get_sighash_all(byte[] funding_redeemscript, long channel_value_satoshis) {
38 byte[] ret = bindings.TrustedClosingTransaction_get_sighash_all(this.ptr, funding_redeemscript, channel_value_satoshis);
40 GC.KeepAlive(funding_redeemscript);
41 GC.KeepAlive(channel_value_satoshis);
46 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
47 * because we are about to broadcast a holder transaction.
49 public byte[] sign(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis) {
50 byte[] ret = bindings.TrustedClosingTransaction_sign(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis);
52 GC.KeepAlive(funding_key);
53 GC.KeepAlive(funding_redeemscript);
54 GC.KeepAlive(channel_value_satoshis);