@@ -686,7 +686,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
686
686
}
687
687
} else { None } ;
688
688
689
- let mut chan = Channel {
689
+ let chan = Channel {
690
690
user_id : user_id,
691
691
config : local_config,
692
692
@@ -762,10 +762,6 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
762
762
logger,
763
763
} ;
764
764
765
- let obscure_factor = chan. get_commitment_transaction_number_obscure_factor ( ) ;
766
- let funding_redeemscript = chan. get_funding_redeemscript ( ) ;
767
- chan. channel_monitor . set_basic_channel_info ( & msg. htlc_basepoint , & msg. delayed_payment_basepoint , msg. to_self_delay , funding_redeemscript, msg. funding_satoshis , obscure_factor) ;
768
-
769
765
Ok ( chan)
770
766
}
771
767
@@ -1435,10 +1431,6 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
1435
1431
self . their_cur_commitment_point = Some ( msg. first_per_commitment_point ) ;
1436
1432
self . their_shutdown_scriptpubkey = their_shutdown_scriptpubkey;
1437
1433
1438
- let obscure_factor = self . get_commitment_transaction_number_obscure_factor ( ) ;
1439
- let funding_redeemscript = self . get_funding_redeemscript ( ) ;
1440
- self . channel_monitor . set_basic_channel_info ( & msg. htlc_basepoint , & msg. delayed_payment_basepoint , msg. to_self_delay , funding_redeemscript, self . channel_value_satoshis , obscure_factor) ;
1441
-
1442
1434
self . channel_state = ChannelState :: OurInitSent as u32 | ChannelState :: TheirInitSent as u32 ;
1443
1435
1444
1436
Ok ( ( ) )
@@ -1496,7 +1488,11 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
1496
1488
}
1497
1489
} ;
1498
1490
1499
- let funding_txo_script = self . get_funding_redeemscript ( ) . to_v0_p2wsh ( ) ;
1491
+ let their_pubkeys = self . their_pubkeys . as_ref ( ) . unwrap ( ) ;
1492
+ let funding_redeemscript = self . get_funding_redeemscript ( ) ;
1493
+ self . channel_monitor . set_basic_channel_info ( & their_pubkeys. htlc_basepoint , & their_pubkeys. delayed_payment_basepoint , self . their_to_self_delay , funding_redeemscript. clone ( ) , self . channel_value_satoshis , self . get_commitment_transaction_number_obscure_factor ( ) ) ;
1494
+
1495
+ let funding_txo_script = funding_redeemscript. to_v0_p2wsh ( ) ;
1500
1496
self . channel_monitor . set_funding_info ( ( funding_txo, funding_txo_script) ) ;
1501
1497
1502
1498
// Now that we're past error-generating stuff, update our local state:
@@ -3314,7 +3310,11 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
3314
3310
}
3315
3311
} ;
3316
3312
3317
- let funding_txo_script = self . get_funding_redeemscript ( ) . to_v0_p2wsh ( ) ;
3313
+ let their_pubkeys = self . their_pubkeys . as_ref ( ) . unwrap ( ) ;
3314
+ let funding_redeemscript = self . get_funding_redeemscript ( ) ;
3315
+ self . channel_monitor . set_basic_channel_info ( & their_pubkeys. htlc_basepoint , & their_pubkeys. delayed_payment_basepoint , self . their_to_self_delay , funding_redeemscript. clone ( ) , self . channel_value_satoshis , self . get_commitment_transaction_number_obscure_factor ( ) ) ;
3316
+
3317
+ let funding_txo_script = funding_redeemscript. to_v0_p2wsh ( ) ;
3318
3318
self . channel_monitor . set_funding_info ( ( funding_txo, funding_txo_script) ) ;
3319
3319
let temporary_channel_id = self . channel_id ;
3320
3320
0 commit comments