[][src]Struct lightning::ln::channelmanager::ChannelManagerReadArgs

pub struct ChannelManagerReadArgs<'a, 'b> {
    pub keys_manager: Arc<dyn KeysInterface>,
    pub fee_estimator: Arc<dyn FeeEstimator>,
    pub monitor: Arc<dyn ManyChannelMonitor + 'b>,
    pub tx_broadcaster: Arc<dyn BroadcasterInterface>,
    pub logger: Arc<dyn Logger>,
    pub default_config: UserConfig,
    pub channel_monitors: &'a HashMap<OutPoint, &'a ChannelMonitor>,
}

Arguments for the creation of a ChannelManager that are not deserialized.

At a high-level, the process for deserializing a ChannelManager and resuming normal operation is:

  1. Deserialize all stored ChannelMonitors.
  2. Deserialize the ChannelManager by filling in this struct and calling <(Sha256dHash, ChannelManager)>::read(reader, args). This may result in closing some Channels if the ChannelMonitor is newer than the stored ChannelManager state to ensure no loss of funds. Thus, transactions may be broadcasted.
  3. Register all relevant ChannelMonitor outpoints with your chain watch mechanism using ChannelMonitor::get_monitored_outpoints and ChannelMonitor::get_funding_txo().
  4. Reconnect blocks on your ChannelMonitors.
  5. Move the ChannelMonitors into your local ManyChannelMonitor.
  6. Disconnect/connect blocks on the ChannelManager.
  7. Register the new ChannelManager with your ChainWatchInterface.

Fields

keys_manager: Arc<dyn KeysInterface>

The keys provider which will give us relevant keys. Some keys will be loaded during deserialization.

fee_estimator: Arc<dyn FeeEstimator>

The fee_estimator for use in the ChannelManager in the future.

No calls to the FeeEstimator will be made during deserialization.

monitor: Arc<dyn ManyChannelMonitor + 'b>

The ManyChannelMonitor for use in the ChannelManager in the future.

No calls to the ManyChannelMonitor will be made during deserialization. It is assumed that you have deserialized ChannelMonitors separately and will add them to your ManyChannelMonitor after deserializing this ChannelManager.

tx_broadcaster: Arc<dyn BroadcasterInterface>

The BroadcasterInterface which will be used in the ChannelManager in the future and may be used to broadcast the latest local commitment transactions of channels which must be force-closed during deserialization.

logger: Arc<dyn Logger>

The Logger for use in the ChannelManager and which may be used to log information during deserialization.

default_config: UserConfig

Default settings used for new channels. Any existing channels will continue to use the runtime settings which were stored when the ChannelManager was serialized.

channel_monitors: &'a HashMap<OutPoint, &'a ChannelMonitor>

A map from channel funding outpoints to ChannelMonitors for those channels (ie value.get_funding_txo() should be the key).

If a monitor is inconsistent with the channel state during deserialization the channel will be force-closed using the data in the ChannelMonitor and the channel will be dropped. This is true for missing channels as well. If there is a monitor missing for which we find channel data Err(DecodeError::InvalidValue) will be returned.

In such cases the latest local transactions will be sent to the tx_broadcaster included in this struct.

Trait Implementations

impl<'a, 'b, R: Read> ReadableArgs<R, ChannelManagerReadArgs<'a, 'b>> for (Sha256dHash, ChannelManager<'b>)[src]

Auto Trait Implementations

impl<'a, 'b> !RefUnwindSafe for ChannelManagerReadArgs<'a, 'b>

impl<'a, 'b> Send for ChannelManagerReadArgs<'a, 'b>

impl<'a, 'b> Sync for ChannelManagerReadArgs<'a, 'b>

impl<'a, 'b> Unpin for ChannelManagerReadArgs<'a, 'b>

impl<'a, 'b> !UnwindSafe for ChannelManagerReadArgs<'a, 'b>

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, 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.