pub enum Channel {
Offered(OfferedChannel),
Accepted(AcceptedChannel),
Signed(SignedChannel),
FailedAccept(FailedAccept),
FailedSign(FailedSign),
Cancelled(OfferedChannel),
Closing(ClosingChannel),
Closed(ClosedChannel),
CounterClosed(ClosedChannel),
ClosedPunished(ClosedPunishedChannel),
CollaborativelyClosed(ClosedChannel),
}
Expand description
Enumeration containing the possible state a DLC channel can be in.
Variants§
Offered(OfferedChannel)
A channel that has been offered.
Accepted(AcceptedChannel)
A channel that has been accepted.
Signed(SignedChannel)
A channel whose fund outputs have been signed by the offer party.
FailedAccept(FailedAccept)
A channel that failed when validating an
[dlc_messages::channel::AcceptChannel
] message.
FailedSign(FailedSign)
A channel that failed when validating an
[dlc_messages::channel::SignChannel
] message.
Cancelled(OfferedChannel)
A OfferedChannel
that got rejected by the counterparty.
Closing(ClosingChannel)
A Channel
is in Closing
state when the local party
has broadcast a buffer transaction and is waiting to finalize the
closing of the channel by broadcasting a CET.
Closed(ClosedChannel)
A Channel
is in Closed
state when it was force closed by
the local party.
CounterClosed(ClosedChannel)
A Channel
is in CounterClosed
state when it was force
closed by the counter party.
ClosedPunished(ClosedPunishedChannel)
A Channel
is in ClosedPunished
state when the local
party broadcast a punishment transaction in response to the counter
party broadcasting a settle or buffer transaction for a revoked channel
state.
CollaborativelyClosed(ClosedChannel)
A SignedChannel
is in CollaborativelyClosed
state when it was
collaboratively closed.
Implementations§
Source§impl Channel
impl Channel
Sourcepub fn get_counter_party_id(&self) -> PublicKey
pub fn get_counter_party_id(&self) -> PublicKey
Returns the public key of the counter party’s node.
Source§impl Channel
impl Channel
Sourcepub fn get_temporary_id(&self) -> ChannelId
pub fn get_temporary_id(&self) -> ChannelId
Returns the temporary crate::ChannelId
for the channel.
Sourcepub fn get_id(&self) -> ChannelId
pub fn get_id(&self) -> ChannelId
Returns the crate::ChannelId
for the channel.
Sourcepub fn get_contract_id(&self) -> Option<ContractId>
pub fn get_contract_id(&self) -> Option<ContractId>
Returns the contract id associated with the channel if in a state where a contract is set.