@@ -5252,18 +5252,14 @@ where
52525252 // See test_duplicate_chan_id and test_pre_lockin_no_chan_closed_update for more.
52535253 if !self.channel_state.is_pre_funded_state() {
52545254 self.latest_monitor_update_id += 1;
5255- Some((
5256- self.get_counterparty_node_id(),
5257- funding_txo,
5258- self.channel_id(),
5259- ChannelMonitorUpdate {
5260- update_id: self.latest_monitor_update_id,
5261- updates: vec![ChannelMonitorUpdateStep::ChannelForceClosed {
5262- should_broadcast,
5263- }],
5264- channel_id: Some(self.channel_id()),
5265- },
5266- ))
5255+ let update = ChannelMonitorUpdate {
5256+ update_id: self.latest_monitor_update_id,
5257+ updates: vec![ChannelMonitorUpdateStep::ChannelForceClosed {
5258+ should_broadcast,
5259+ }],
5260+ channel_id: Some(self.channel_id()),
5261+ };
5262+ Some((self.get_counterparty_node_id(), funding_txo, self.channel_id(), update))
52675263 } else {
52685264 None
52695265 }
@@ -8539,14 +8535,12 @@ where
85398535 let sighash = closing_tx
85408536 .trust()
85418537 .get_sighash_all(&funding_redeemscript, self.funding.get_value_satoshis());
8542- secp_check!(
8543- self.context.secp_ctx.verify_ecdsa(
8544- &sighash,
8545- &msg.signature,
8546- self.funding.counterparty_funding_pubkey()
8547- ),
8548- "Invalid closing tx signature from peer".to_owned()
8538+ let res = self.context.secp_ctx.verify_ecdsa(
8539+ &sighash,
8540+ &msg.signature,
8541+ self.funding.counterparty_funding_pubkey(),
85498542 );
8543+ secp_check!(res, "Invalid closing tx signature from peer".to_owned());
85508544 },
85518545 };
85528546
@@ -12635,14 +12629,16 @@ mod tests {
1263512629 let keys_provider = TestKeysInterface::new(&seed, network);
1263612630 keys_provider
1263712631 .expect(OnGetShutdownScriptpubkey { returns: non_v0_segwit_shutdown_script.clone() });
12632+ let fee_estimator = TestFeeEstimator::new(253);
12633+ let bounded_fee_estimator = LowerBoundedFeeEstimator::new(&fee_estimator);
1263812634 let logger = TestLogger::new();
1263912635
1264012636 let secp_ctx = Secp256k1::new();
1264112637 let node_id =
1264212638 PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[42; 32]).unwrap());
1264312639 let config = UserConfig::default();
12644- match OutboundV1Channel::<&TestKeysInterface> ::new(
12645- &LowerBoundedFeeEstimator::new(&TestFeeEstimator::new(253)) ,
12640+ let res = OutboundV1Channel::new(
12641+ &bounded_fee_estimator ,
1264612642 &&keys_provider,
1264712643 &&keys_provider,
1264812644 node_id,
@@ -12655,7 +12651,8 @@ mod tests {
1265512651 42,
1265612652 None,
1265712653 &logger,
12658- ) {
12654+ );
12655+ match res {
1265912656 Err(APIError::IncompatibleShutdownScript { script }) => {
1266012657 assert_eq!(script.into_inner(), non_v0_segwit_shutdown_script.into_inner());
1266112658 },
0 commit comments