Struct lightning::ln::chan_utils::TrustedClosingTransaction
source · [−]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
sourceimpl<'a> TrustedClosingTransaction<'a>
impl<'a> TrustedClosingTransaction<'a>
sourcepub fn built_transaction(&self) -> &Transaction
pub fn built_transaction(&self) -> &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
Trait Implementations
sourceimpl<'a> Deref for TrustedClosingTransaction<'a>
impl<'a> Deref for TrustedClosingTransaction<'a>
type Target = ClosingTransaction
type Target = ClosingTransaction
The resulting type after dereferencing.
Auto Trait Implementations
impl<'a> RefUnwindSafe for TrustedClosingTransaction<'a>
impl<'a> Send for TrustedClosingTransaction<'a>
impl<'a> Sync for TrustedClosingTransaction<'a>
impl<'a> Unpin for TrustedClosingTransaction<'a>
impl<'a> UnwindSafe for TrustedClosingTransaction<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more