From f52f777c97887deba2814e9e9d9f82cd629b5cc4 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 8 Mar 2021 00:06:31 -0500 Subject: [PATCH] Use the new `load_outputs_to_watch` util in `ChainMonitor` This is slightly more effecient as it avoids a clone, but its also nice to use our own code more. --- lightning/src/chain/chainmonitor.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lightning/src/chain/chainmonitor.rs b/lightning/src/chain/chainmonitor.rs index de826d054..0cf2d56a1 100644 --- a/lightning/src/chain/chainmonitor.rs +++ b/lightning/src/chain/chainmonitor.rs @@ -193,12 +193,7 @@ where C::Target: chain::Filter, log_trace!(self.logger, "Got new Channel Monitor for channel {}", log_bytes!(funding_txo.0.to_channel_id()[..])); if let Some(ref chain_source) = self.chain_source { - chain_source.register_tx(&funding_txo.0.txid, &funding_txo.1); - for (txid, outputs) in monitor.get_outputs_to_watch().iter() { - for (idx, script_pubkey) in outputs.iter() { - chain_source.register_output(&OutPoint { txid: *txid, index: *idx as u16 }, script_pubkey); - } - } + monitor.load_outputs_to_watch(chain_source); } } entry.insert(monitor); -- 2.39.5