[−][src]Struct lightning::ln::channelmanager::ChannelManagerReadArgs
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:
- Deserialize all stored ChannelMonitors.
- 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.
- Register all relevant ChannelMonitor outpoints with your chain watch mechanism using ChannelMonitor::get_outputs_to_watch() and ChannelMonitor::get_funding_txo().
- Reconnect blocks on your ChannelMonitors.
- Move the ChannelMonitors into your local chain::Watch.
- Disconnect/connect blocks on the ChannelManager.
Fields
keys_manager: K
The keys provider which will give us relevant keys. Some keys will be loaded during deserialization.
fee_estimator: F
The fee_estimator for use in the ChannelManager in the future.
No calls to the FeeEstimator will be made during deserialization.
chain_monitor: M
The chain::Watch for use in the ChannelManager in the future.
No calls to the chain::Watch will be made during deserialization. It is assumed that you have deserialized ChannelMonitors separately and will add them to your chain::Watch after deserializing this ChannelManager.
tx_broadcaster: T
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: L
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: HashMap<OutPoint, &'a mut ChannelMonitor<ChanSigner>>
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.
(C-not exported) because we have no HashMap bindings
Implementations
impl<'a, ChanSigner: 'a + ChannelKeys, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelManagerReadArgs<'a, ChanSigner, M, T, K, F, L> where
M::Target: Watch<Keys = ChanSigner>,
T::Target: BroadcasterInterface,
K::Target: KeysInterface<ChanKeySigner = ChanSigner>,
F::Target: FeeEstimator,
L::Target: Logger,
[src]
M::Target: Watch<Keys = ChanSigner>,
T::Target: BroadcasterInterface,
K::Target: KeysInterface<ChanKeySigner = ChanSigner>,
F::Target: FeeEstimator,
L::Target: Logger,
pub fn new(
keys_manager: K,
fee_estimator: F,
chain_monitor: M,
tx_broadcaster: T,
logger: L,
default_config: UserConfig,
channel_monitors: Vec<&'a mut ChannelMonitor<ChanSigner>>
) -> Self
[src]
keys_manager: K,
fee_estimator: F,
chain_monitor: M,
tx_broadcaster: T,
logger: L,
default_config: UserConfig,
channel_monitors: Vec<&'a mut ChannelMonitor<ChanSigner>>
) -> Self
Simple utility function to create a ChannelManagerReadArgs which creates the monitor HashMap for you. This is primarily useful for C bindings where it is not practical to populate a HashMap directly from C.
Trait Implementations
impl<'a, ChanSigner: ChannelKeys + Readable, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ReadableArgs<ChannelManagerReadArgs<'a, ChanSigner, M, T, K, F, L>> for (BlockHash, Arc<ChannelManager<ChanSigner, M, T, K, F, L>>) where
M::Target: Watch<Keys = ChanSigner>,
T::Target: BroadcasterInterface,
K::Target: KeysInterface<ChanKeySigner = ChanSigner>,
F::Target: FeeEstimator,
L::Target: Logger,
[src]
M::Target: Watch<Keys = ChanSigner>,
T::Target: BroadcasterInterface,
K::Target: KeysInterface<ChanKeySigner = ChanSigner>,
F::Target: FeeEstimator,
L::Target: Logger,
pub fn read<R: Read>(
reader: &mut R,
args: ChannelManagerReadArgs<'a, ChanSigner, M, T, K, F, L>
) -> Result<Self, DecodeError>
[src]
reader: &mut R,
args: ChannelManagerReadArgs<'a, ChanSigner, M, T, K, F, L>
) -> Result<Self, DecodeError>
impl<'a, ChanSigner: ChannelKeys + Readable, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ReadableArgs<ChannelManagerReadArgs<'a, ChanSigner, M, T, K, F, L>> for (BlockHash, ChannelManager<ChanSigner, M, T, K, F, L>) where
M::Target: Watch<Keys = ChanSigner>,
T::Target: BroadcasterInterface,
K::Target: KeysInterface<ChanKeySigner = ChanSigner>,
F::Target: FeeEstimator,
L::Target: Logger,
[src]
M::Target: Watch<Keys = ChanSigner>,
T::Target: BroadcasterInterface,
K::Target: KeysInterface<ChanKeySigner = ChanSigner>,
F::Target: FeeEstimator,
L::Target: Logger,
pub fn read<R: Read>(
reader: &mut R,
args: ChannelManagerReadArgs<'a, ChanSigner, M, T, K, F, L>
) -> Result<Self, DecodeError>
[src]
reader: &mut R,
args: ChannelManagerReadArgs<'a, ChanSigner, M, T, K, F, L>
) -> Result<Self, DecodeError>
Auto Trait Implementations
impl<'a, ChanSigner, M, T, K, F, L> RefUnwindSafe for ChannelManagerReadArgs<'a, ChanSigner, M, T, K, F, L> where
ChanSigner: RefUnwindSafe,
F: RefUnwindSafe,
K: RefUnwindSafe,
L: RefUnwindSafe,
M: RefUnwindSafe,
T: RefUnwindSafe,
ChanSigner: RefUnwindSafe,
F: RefUnwindSafe,
K: RefUnwindSafe,
L: RefUnwindSafe,
M: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, ChanSigner, M, T, K, F, L> Send for ChannelManagerReadArgs<'a, ChanSigner, M, T, K, F, L> where
F: Send,
K: Send,
L: Send,
M: Send,
T: Send,
F: Send,
K: Send,
L: Send,
M: Send,
T: Send,
impl<'a, ChanSigner, M, T, K, F, L> Sync for ChannelManagerReadArgs<'a, ChanSigner, M, T, K, F, L> where
ChanSigner: Sync,
F: Sync,
K: Sync,
L: Sync,
M: Sync,
T: Sync,
ChanSigner: Sync,
F: Sync,
K: Sync,
L: Sync,
M: Sync,
T: Sync,
impl<'a, ChanSigner, M, T, K, F, L> Unpin for ChannelManagerReadArgs<'a, ChanSigner, M, T, K, F, L> where
F: Unpin,
K: Unpin,
L: Unpin,
M: Unpin,
T: Unpin,
F: Unpin,
K: Unpin,
L: Unpin,
M: Unpin,
T: Unpin,
impl<'a, ChanSigner, M, T, K, F, L> !UnwindSafe for ChannelManagerReadArgs<'a, ChanSigner, M, T, K, F, L>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,