pub struct TrustedClosingTransaction<'a> { /* private fields */ }Expand description
A wrapper on ClosingTransaction indicating that the built bitcoin transaction is trusted.
See trust() and verify() functions on CommitmentTransaction.
This structure implements Deref.
Implementations§
Source§impl<'a> TrustedClosingTransaction<'a>
impl<'a> TrustedClosingTransaction<'a>
Sourcepub fn built_transaction(&self) -> &'a Transaction
pub fn built_transaction(&self) -> &'a Transaction
The pre-built Bitcoin commitment transaction
Sourcepub fn get_sighash_all(
&self,
funding_redeemscript: &Script,
channel_value_satoshis: u64,
) -> Message
pub fn get_sighash_all( &self, funding_redeemscript: &Script, channel_value_satoshis: u64, ) -> Message
Get the SIGHASH_ALL sighash value of the transaction.
This can be used to verify a signature.
Sourcepub fn sign<T: Signing>(
&self,
funding_key: &SecretKey,
funding_redeemscript: &Script,
channel_value_satoshis: u64,
secp_ctx: &Secp256k1<T>,
) -> Signature
pub fn sign<T: Signing>( &self, funding_key: &SecretKey, funding_redeemscript: &Script, channel_value_satoshis: u64, secp_ctx: &Secp256k1<T>, ) -> Signature
Sign a transaction, either because we are counter-signing the counterparty’s transaction or because we are about to broadcast a holder transaction.
Methods from Deref<Target = ClosingTransaction>§
Sourcepub fn trust(&self) -> TrustedClosingTransaction<'_>
pub fn trust(&self) -> TrustedClosingTransaction<'_>
Trust our pre-built transaction.
Applies a wrapper which allows access to the transaction.
This should only be used if you fully trust the builder of this object. It should not be used by an external signer - instead use the verify function.
Sourcepub fn verify(
&self,
funding_outpoint: OutPoint,
) -> Result<TrustedClosingTransaction<'_>, ()>
pub fn verify( &self, funding_outpoint: OutPoint, ) -> Result<TrustedClosingTransaction<'_>, ()>
Verify our pre-built transaction.
Applies a wrapper which allows access to the transaction.
An external validating signer must call this method before signing or using the built transaction.
Sourcepub fn to_holder_value_sat(&self) -> u64
pub fn to_holder_value_sat(&self) -> u64
The value to be sent to the holder, or zero if the output will be omitted
Sourcepub fn to_counterparty_value_sat(&self) -> u64
pub fn to_counterparty_value_sat(&self) -> u64
The value to be sent to the counterparty, or zero if the output will be omitted
Sourcepub fn to_holder_script(&self) -> &Script
pub fn to_holder_script(&self) -> &Script
The destination of the holder’s output
Sourcepub fn to_counterparty_script(&self) -> &Script
pub fn to_counterparty_script(&self) -> &Script
The destination of the counterparty’s output