[][src]Enum lightning::ln::channelmonitor::ChannelMonitorUpdateErr

pub enum ChannelMonitorUpdateErr {
    TemporaryFailure,
    PermanentFailure,
}

An error enum representing a failure to persist a channel monitor update.

Variants

TemporaryFailure

Used to indicate a temporary failure (eg connection to a watchtower or remote backup of our state failed, but is expected to succeed at some point in the future).

Such a failure will "freeze" a channel, preventing us from revoking old states or submitting new commitment transactions to the remote party. ChannelManager::test_restore_channel_monitor can be used to retry the update(s) and restore the channel to an operational state.

Note that continuing to operate when no copy of the updated ChannelMonitor could be persisted is unsafe - if you failed to store the update on your own local disk you should instead return PermanentFailure to force closure of the channel ASAP.

Even when a channel has been "frozen" updates to the ChannelMonitor can continue to occur (eg if an inbound HTLC which we forwarded was claimed upstream resulting in us attempting to claim it on this channel) and those updates must be applied wherever they can be. At least one such updated ChannelMonitor must be persisted otherwise PermanentFailure should be returned to get things on-chain ASAP using only the in-memory copy. Obviously updates to the channel which would invalidate previous ChannelMonitors are not made when a channel has been "frozen".

Note that even if updates made after TemporaryFailure succeed you must still call test_restore_channel_monitor to ensure you have the latest monitor and re-enable normal channel operation.

For deployments where a copy of ChannelMonitors and other local state are backed up in a remote location (with local copies persisted immediately), it is anticipated that all updates will return TemporaryFailure until the remote copies could be updated.

PermanentFailure

Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a different watchtower and cannot update with all watchtowers that were previously informed of this channel). This will force-close the channel in question.

Should also be used to indicate a failure to update the local copy of the channel monitor.

Trait Implementations

impl Clone for ChannelMonitorUpdateErr[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = !

The type returned in the event of a conversion error.

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.