Module dlc_manager::channel_updater
source · Functions
Move the given
OfferedChannel
and OfferedContract
to an AcceptedChannel
and AcceptedContract
, returning them as well as the AcceptChannel
message to be sent to the counter party.Creates a
RenewAccept
message from the given SignedChannel
and other
parameters, updating the state of the channel and the associated contract the
same time. Expects the channel to be in SignedChannelState::RenewOffered
state.Accept an offer to collaboratively close the channel, signing the
closing transaction and returning it.
Sign the settlement transaction and update the state of the channel.
Sign the buffer transaction and closing CET and update the state of the channel.
Creates an
OfferedChannel
and an associated OfferedContract
using
the given parameter.Creates a
CollaborativeCloseOffer
message and update the state of the
given SignedChannel
.Validates the given
CollaborativeCloseOffer
and updates the state of the
channel.Update the state of the channel if currently in a state that can be rejected.
Update the state of the given
SignedChannel
from the given RenewOffer
.
Expects the channel to be in one of SignedChannelState::Settled
or
SignedChannelState::Established
state.Updates the state of the given
SignedChannel
using the given SettleOffer
message.Creates a
Reject
message and rolls back the state of the channel. Expects
the channel to be in SignedChannelState::RenewOffered
state and the local
party not to be the offer party.Creates a
Reject
message and rolls back the state of the channel. Expects
the channel to be in SignedChannelState::SettledOffered
state.Verify the given
RenewFinalize
and update the state of the channel.Creates a
RenewOffer
message and OfferedContract
for the given channel
using the provided parameters.Creates a
SettleAccept
message from the given SignedChannel
and other
parameters, updating the state of the channel at the same time. Expects the
channel to be in SignedChannelState::SettledReceived
state.Creates a
SettleConfirm
message from the given SignedChannel
and
SettleAccept
message, verifying the content of the message and updating
the state of the channel at the same time. Expects the channel to be in
SignedChannelState::SettledOffered
state.Creates a
SettleFinalize
message from the given SignedChannel
and
SettleConfirm
message, validating the message and updating the state of
the channel at the same time. Expects the channel to be in
SignedChannelState::SettledAccepted
state.Creates a
SettleOffer
message from the given SignedChannel
and parameters,
updating the state of the channel at the same time. Expects the
channel to be in SignedChannelState::Established
state.Checks that the
SettleFinalize
message is valid with respect to the given
channel and updates the state of the channel.
Expects the channel to be in SignedChannelState::SettledConfirmed
state.Verify that the
AcceptChannel
message is valid with respect
to the given OfferedChannel
and OfferedContract
, transforming them
to a SignedChannel
and SignedContract
, returning them as well as the
SignChannel
to be sent to the counter party.Creates a
RenewConfirm
message from the given SignedChannel
and
RenewAccept
message, verifying the message and updating the state of the
channel and associated contract the same time. Expects the channel to be in
SignedChannelState::RenewOffered
state.Creates a
RenewFinalize
message from the given SignedChannel
and
RenewAccept
message, verifying the message and updating the state of the
channel and associated contract the same time. Expects the channel to be in
SignedChannelState::RenewAccepted
state.Verify that the given
SignChannel
message is valid with respect to the
given AcceptedChannel
and AcceptedContract
, transforming them
to a SignedChannel
and SignedContract
, and returning them.