+ ///
+ /// (C-not exported) because we have no HashMap bindings
+ pub channel_monitors: HashMap<OutPoint, &'a mut ChannelMonitor<ChanSigner>>,
+}
+
+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: chain::Watch<Keys=ChanSigner>,
+ T::Target: BroadcasterInterface,
+ K::Target: KeysInterface<ChanKeySigner = ChanSigner>,
+ F::Target: FeeEstimator,
+ L::Target: Logger,
+ {
+ /// 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.
+ pub fn new(keys_manager: K, fee_estimator: F, chain_monitor: M, tx_broadcaster: T, logger: L, default_config: UserConfig,
+ mut channel_monitors: Vec<&'a mut ChannelMonitor<ChanSigner>>) -> Self {
+ Self {
+ keys_manager, fee_estimator, chain_monitor, tx_broadcaster, logger, default_config,
+ channel_monitors: channel_monitors.drain(..).map(|monitor| { (monitor.get_funding_txo().0, monitor) }).collect()
+ }
+ }