Struct lightning::ln::chan_utils::ClosingTransaction
source · pub struct ClosingTransaction { /* private fields */ }
Expand description
This class tracks the per-transaction information needed to build a closing transaction and will actually build it and sign.
This class can be used inside a signer implementation to generate a signature given the relevant secret key.
Implementations§
source§impl ClosingTransaction
impl ClosingTransaction
sourcepub fn new(
to_holder_value_sat: u64,
to_counterparty_value_sat: u64,
to_holder_script: Script,
to_counterparty_script: Script,
funding_outpoint: OutPoint
) -> Self
pub fn new(
to_holder_value_sat: u64,
to_counterparty_value_sat: u64,
to_holder_script: Script,
to_counterparty_script: Script,
funding_outpoint: OutPoint
) -> Self
Construct an object of the class
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§
source§impl Clone for ClosingTransaction
impl Clone for ClosingTransaction
source§fn clone(&self) -> ClosingTransaction
fn clone(&self) -> ClosingTransaction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more