pub enum ChannelState {
NegotiatingFunding(NegotiatingFundingFlags),
CollaboratingFundingTx(CollaboratingFundingTxFlags),
SigningCommitment(SigningCommitmentFlags),
AwaitingTxSignatures(AwaitingTxSignaturesFlags),
AwaitingChannelReady(AwaitingChannelReadyFlags),
ChannelReady,
ShuttingDown(ShuttingDownFlags),
Closed(CloseFlags),
}Expand description
The state of a channel.
Note: fiber-lib uses default serde (bincode-compatible), while fiber-json-types
uses #[serde(tag = "state_name", content = "state_flags")] for JSON.
This definition uses the default (bincode-compatible) representation.
The JSON-specific tagged version is defined in fiber-json-types.
Variants§
NegotiatingFunding(NegotiatingFundingFlags)
We are negotiating the parameters required for the channel prior to funding it.
For channels opened with external funding, this state is also used together with
NegotiatingFundingFlags::AWAITING_EXTERNAL_FUNDING to indicate that we are waiting
for the user to sign and submit the funding transaction externally.
CollaboratingFundingTx(CollaboratingFundingTxFlags)
We’re collaborating with the other party on the funding transaction.
SigningCommitment(SigningCommitmentFlags)
We have collaborated over the funding and are now waiting for CommitmentSigned messages.
AwaitingTxSignatures(AwaitingTxSignaturesFlags)
We’ve received and sent commitment_signed and are now waiting for both
party to collaborate on creating a valid funding transaction.
AwaitingChannelReady(AwaitingChannelReadyFlags)
We’ve received/sent funding_created and funding_signed and are thus now waiting on the
funding transaction to confirm.
ChannelReady
Both we and our counterparty consider the funding transaction confirmed and the channel is now operational.
ShuttingDown(ShuttingDownFlags)
We’ve successfully negotiated a closing_signed dance.
Closed(CloseFlags)
This channel is closed.
Implementations§
Source§impl ChannelState
impl ChannelState
pub fn is_awaiting_external_funding(&self) -> bool
pub fn is_closed(&self) -> bool
pub fn can_abort_funding(&self) -> bool
Trait Implementations§
Source§impl Clone for ChannelState
impl Clone for ChannelState
Source§fn clone(&self) -> ChannelState
fn clone(&self) -> ChannelState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more