+ deserialized_monitors.push(deserialized_monitor);
+ }
+
+ // Before using all the new monitors to check the watch outpoints, use the full set of
+ // them to ensure we can write and reload our ChannelManager.
+ {
+ let mut channel_monitors = HashMap::new();
+ for monitor in deserialized_monitors.iter_mut() {
+ channel_monitors.insert(monitor.get_funding_txo().unwrap(), monitor);
+ }
+
+ let mut w = test_utils::TestVecWriter(Vec::new());
+ self.node.write(&mut w).unwrap();
+ <(Sha256d, ChannelManager<EnforcingChannelKeys, &test_utils::TestChannelMonitor>)>::read(&mut ::std::io::Cursor::new(w.0), ChannelManagerReadArgs {
+ default_config: UserConfig::default(),
+ keys_manager: self.keys_manager.clone(),
+ fee_estimator: Arc::new(test_utils::TestFeeEstimator { sat_per_kw: 253 }),
+ monitor: self.chan_monitor,
+ tx_broadcaster: self.tx_broadcaster.clone(),
+ logger: Arc::new(test_utils::TestLogger::new()),
+ channel_monitors: &mut channel_monitors,
+ }).unwrap();
+ }
+
+ let chain_watch = Arc::new(chaininterface::ChainWatchInterfaceUtil::new(Network::Testnet, Arc::clone(&self.logger) as Arc<Logger>));
+ let channel_monitor = test_utils::TestChannelMonitor::new(chain_watch.clone(), self.tx_broadcaster.clone(), self.logger.clone(), feeest);
+ for deserialized_monitor in deserialized_monitors.drain(..) {