@@ -5252,18 +5252,14 @@ where
5252
5252
// See test_duplicate_chan_id and test_pre_lockin_no_chan_closed_update for more.
5253
5253
if !self.channel_state.is_pre_funded_state() {
5254
5254
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))
5267
5263
} else {
5268
5264
None
5269
5265
}
@@ -8539,14 +8535,12 @@ where
8539
8535
let sighash = closing_tx
8540
8536
.trust()
8541
8537
.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(),
8549
8542
);
8543
+ secp_check!(res, "Invalid closing tx signature from peer".to_owned());
8550
8544
},
8551
8545
};
8552
8546
@@ -12635,14 +12629,16 @@ mod tests {
12635
12629
let keys_provider = TestKeysInterface::new(&seed, network);
12636
12630
keys_provider
12637
12631
.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);
12638
12634
let logger = TestLogger::new();
12639
12635
12640
12636
let secp_ctx = Secp256k1::new();
12641
12637
let node_id =
12642
12638
PublicKey::from_secret_key(&secp_ctx, &SecretKey::from_slice(&[42; 32]).unwrap());
12643
12639
let config = UserConfig::default();
12644
- match OutboundV1Channel::<&TestKeysInterface> ::new(
12645
- &LowerBoundedFeeEstimator::new(&TestFeeEstimator::new(253)) ,
12640
+ let res = OutboundV1Channel::new(
12641
+ &bounded_fee_estimator ,
12646
12642
&&keys_provider,
12647
12643
&&keys_provider,
12648
12644
node_id,
@@ -12655,7 +12651,8 @@ mod tests {
12655
12651
42,
12656
12652
None,
12657
12653
&logger,
12658
- ) {
12654
+ );
12655
+ match res {
12659
12656
Err(APIError::IncompatibleShutdownScript { script }) => {
12660
12657
assert_eq!(script.into_inner(), non_v0_segwit_shutdown_script.into_inner());
12661
12658
},
0 commit comments