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: ScriptBuf,
to_counterparty_script: ScriptBuf,
funding_outpoint: OutPoint,
) -> Self
pub fn new( to_holder_value_sat: u64, to_counterparty_value_sat: u64, to_holder_script: ScriptBuf, to_counterparty_script: ScriptBuf, 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