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
sourceimpl 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
sourceimpl Clone for ClosingTransaction
impl Clone for ClosingTransaction
sourcefn clone(&self) -> ClosingTransaction
fn clone(&self) -> ClosingTransaction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Hash for ClosingTransaction
impl Hash for ClosingTransaction
sourceimpl PartialEq<ClosingTransaction> for ClosingTransaction
impl PartialEq<ClosingTransaction> for ClosingTransaction
sourcefn eq(&self, other: &ClosingTransaction) -> bool
fn eq(&self, other: &ClosingTransaction) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ClosingTransaction) -> bool
fn ne(&self, other: &ClosingTransaction) -> bool
This method tests for !=
.
impl StructuralPartialEq for ClosingTransaction
Auto Trait Implementations
impl RefUnwindSafe for ClosingTransaction
impl Send for ClosingTransaction
impl Sync for ClosingTransaction
impl Unpin for ClosingTransaction
impl UnwindSafe for ClosingTransaction
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more