Skip to content

Commit f52f777

Browse files
committed
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.
1 parent 154dfe5 commit f52f777

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lightning/src/chain/chainmonitor.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,7 @@ where C::Target: chain::Filter,
193193
log_trace!(self.logger, "Got new Channel Monitor for channel {}", log_bytes!(funding_txo.0.to_channel_id()[..]));
194194

195195
if let Some(ref chain_source) = self.chain_source {
196-
chain_source.register_tx(&funding_txo.0.txid, &funding_txo.1);
197-
for (txid, outputs) in monitor.get_outputs_to_watch().iter() {
198-
for (idx, script_pubkey) in outputs.iter() {
199-
chain_source.register_output(&OutPoint { txid: *txid, index: *idx as u16 }, script_pubkey);
200-
}
201-
}
196+
monitor.load_outputs_to_watch(chain_source);
202197
}
203198
}
204199
entry.insert(monitor);

0 commit comments

Comments
 (0)