Allow toggling specific signing methods in test channel signer
[rust-lightning] / lightning / src / chain / channelmonitor.rs
index 6291006fc9cb1c6a6fc99a96f7f6561e355d8ab4..5cc8030a6a1dc33b8ad58c1bb877ee808f34a6a0 100644 (file)
@@ -1928,6 +1928,12 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
                let inner = self.inner.lock().unwrap();
                f(&inner.onchain_tx_handler.signer);
        }
+
+       #[cfg(test)]
+       pub fn do_mut_signer_call<F: FnMut(&mut Signer) -> ()>(&self, mut f: F) {
+               let mut inner = self.inner.lock().unwrap();
+               f(&mut inner.onchain_tx_handler.signer);
+       }
 }
 
 impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
@@ -2873,7 +2879,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitorImpl<Signer> {
                F::Target: FeeEstimator,
                L::Target: Logger,
        {
-               let (claimable_outpoints, _) = self.generate_claimable_outpoints_and_watch_outputs(ClosureReason::HolderForceClosed);
+               let (claimable_outpoints, _) = self.generate_claimable_outpoints_and_watch_outputs(ClosureReason::HolderForceClosed { broadcasted_latest_txn: Some(true) });
                self.onchain_tx_handler.update_claims_view_from_requests(
                        claimable_outpoints, self.best_block.height, self.best_block.height, broadcaster,
                        fee_estimator, logger