Struct lightning_signer::node::node::Channel[][src]

pub struct Channel {
    pub node: Arc<Node>,
    pub nonce: Vec<u8>,
    pub logger: Arc<dyn SyncLogger>,
    pub secp_ctx: Secp256k1<All>,
    pub keys: EnforcingSigner,
    pub setup: ChannelSetup,
    pub id0: ChannelId,
    pub id: Option<ChannelId>,
}

Fields

node: Arc<Node>nonce: Vec<u8>logger: Arc<dyn SyncLogger>secp_ctx: Secp256k1<All>keys: EnforcingSignersetup: ChannelSetupid0: ChannelIdid: Option<ChannelId>

Implementations

impl Channel[src]

pub fn sign_counterparty_commitment_tx_phase2(
    &self,
    remote_per_commitment_point: &PublicKey,
    commitment_number: u64,
    feerate_per_kw: u32,
    to_holder_value_sat: u64,
    to_counterparty_value_sat: u64,
    offered_htlcs: Vec<HTLCInfo2>,
    received_htlcs: Vec<HTLCInfo2>
) -> Result<(Vec<u8>, Vec<Vec<u8>>), Status>
[src]

Sign a counterparty commitment transaction after rebuilding it from the supplied arguments.

pub fn sign_holder_commitment_tx_phase2(
    &self,
    commitment_number: u64,
    feerate_per_kw: u32,
    to_holder_value_sat: u64,
    to_counterparty_value_sat: u64,
    offered_htlcs: Vec<HTLCInfo2>,
    received_htlcs: Vec<HTLCInfo2>
) -> Result<(Vec<u8>, Vec<Vec<u8>>), Status>
[src]

Sign a holder commitment transaction after rebuilding it from the supplied arguments.

pub fn make_channel_parameters(&self) -> ChannelTransactionParameters[src]

Build channel parameters, used to further build a commitment transaction

pub fn get_shutdown_script(&self) -> Script[src]

Get the shutdown script where our funds will go when we mutual-close

pub fn sign_mutual_close_tx_phase2(
    &self,
    to_holder_value_sat: u64,
    to_counterparty_value_sat: u64,
    counterparty_shutdown_script: Option<Script>
) -> Result<Signature, Status>
[src]

Sign a mutual close transaction after rebuilding it from the supplied arguments

pub fn sign_delayed_sweep(
    &self,
    tx: &Transaction,
    input: usize,
    commitment_number: u64,
    redeemscript: &Script,
    htlc_amount_sat: u64
) -> Result<Signature, Status>
[src]

Sign a delayed output that goes to us while sweeping a transaction we broadcast

pub fn sign_counterparty_htlc_sweep(
    &self,
    tx: &Transaction,
    input: usize,
    remote_per_commitment_point: &PublicKey,
    redeemscript: &Script,
    htlc_amount_sat: u64
) -> Result<Signature, Status>
[src]

Sign TODO

pub fn sign_justice_sweep(
    &self,
    tx: &Transaction,
    input: usize,
    revocation_secret: &SecretKey,
    redeemscript: &Script,
    htlc_amount_sat: u64
) -> Result<Signature, Status>
[src]

Sign a justice transaction on an old state that the counterparty broadcast

pub fn sign_channel_announcement(
    &self,
    announcement: &Vec<u8>
) -> (Signature, Signature)
[src]

Sign a channel announcement with both the node key and the funding key

pub fn network(&self) -> Network[src]

impl Channel[src]

pub fn build_holder_commitment_info(
    &self,
    per_commitment_point: &PublicKey,
    to_holder_value_sat: u64,
    to_counterparty_value_sat: u64,
    offered_htlcs: Vec<HTLCInfo2>,
    received_htlcs: Vec<HTLCInfo2>
) -> Result<CommitmentInfo2, Status>
[src]

pub fn sign_counterparty_commitment_tx(
    &self,
    tx: &Transaction,
    output_witscripts: &Vec<Vec<u8>>,
    remote_per_commitment_point: &PublicKey,
    channel_value_sat: u64,
    payment_hashmap: &Map<[u8; 20], PaymentHash>,
    commitment_number: u64
) -> Result<Vec<u8>, Status>
[src]

Phase 1

pub fn sign_holder_commitment_tx(
    &self,
    tx: &Transaction,
    funding_amount_sat: u64
) -> Result<Signature, Status>
[src]

pub fn sign_mutual_close_tx(
    &self,
    tx: &Transaction,
    funding_amount_sat: u64
) -> Result<Signature, Status>
[src]

Phase 1

pub fn sign_holder_htlc_tx(
    &self,
    tx: &Transaction,
    commitment_number: u64,
    opt_per_commitment_point: Option<PublicKey>,
    redeemscript: &Script,
    htlc_amount_sat: u64
) -> Result<Signature, Status>
[src]

Phase 1

pub fn sign_counterparty_htlc_tx(
    &self,
    tx: &Transaction,
    remote_per_commitment_point: &PublicKey,
    redeemscript: &Script,
    htlc_amount_sat: u64
) -> Result<Signature, Status>
[src]

Phase 1

pub fn get_unilateral_close_key(
    &self,
    commitment_point: &Option<PublicKey>
) -> Result<SecretKey, Status>
[src]

Trait Implementations

impl ChannelBase for Channel[src]

fn get_channel_basepoints(&self) -> ChannelPublicKeys[src]

fn get_per_commitment_point(&self, commitment_number: u64) -> PublicKey[src]

fn get_per_commitment_secret(&self, commitment_number: u64) -> SecretKey[src]

fn nonce(&self) -> Vec<u8>[src]

impl Clone for Channel[src]

fn clone(&self) -> Channel[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Channel[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl !RefUnwindSafe for Channel

impl Send for Channel

impl Sync for Channel

impl Unpin for Channel

impl !UnwindSafe for Channel

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.