@@ -689,7 +689,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
689
689
}
690
690
} else { None } ;
691
691
692
- let mut chan = Channel {
692
+ let chan = Channel {
693
693
user_id : user_id,
694
694
config : local_config,
695
695
@@ -765,10 +765,6 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
765
765
logger,
766
766
} ;
767
767
768
- let obscure_factor = chan. get_commitment_transaction_number_obscure_factor ( ) ;
769
- let funding_redeemscript = chan. get_funding_redeemscript ( ) ;
770
- 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) ;
771
-
772
768
Ok ( chan)
773
769
}
774
770
@@ -1438,10 +1434,6 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
1438
1434
self . their_cur_commitment_point = Some ( msg. first_per_commitment_point ) ;
1439
1435
self . their_shutdown_scriptpubkey = their_shutdown_scriptpubkey;
1440
1436
1441
- let obscure_factor = self . get_commitment_transaction_number_obscure_factor ( ) ;
1442
- let funding_redeemscript = self . get_funding_redeemscript ( ) ;
1443
- 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) ;
1444
-
1445
1437
self . channel_state = ChannelState :: OurInitSent as u32 | ChannelState :: TheirInitSent as u32 ;
1446
1438
1447
1439
Ok ( ( ) )
@@ -1499,7 +1491,11 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
1499
1491
}
1500
1492
} ;
1501
1493
1502
- let funding_txo_script = self . get_funding_redeemscript ( ) . to_v0_p2wsh ( ) ;
1494
+ let their_pubkeys = self . their_pubkeys . as_ref ( ) . unwrap ( ) ;
1495
+ let funding_redeemscript = self . get_funding_redeemscript ( ) ;
1496
+ 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 ( ) ) ;
1497
+
1498
+ let funding_txo_script = funding_redeemscript. to_v0_p2wsh ( ) ;
1503
1499
self . channel_monitor . set_funding_info ( ( funding_txo, funding_txo_script) ) ;
1504
1500
1505
1501
// Now that we're past error-generating stuff, update our local state:
@@ -3330,7 +3326,11 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
3330
3326
}
3331
3327
} ;
3332
3328
3333
- let funding_txo_script = self . get_funding_redeemscript ( ) . to_v0_p2wsh ( ) ;
3329
+ let their_pubkeys = self . their_pubkeys . as_ref ( ) . unwrap ( ) ;
3330
+ let funding_redeemscript = self . get_funding_redeemscript ( ) ;
3331
+ 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 ( ) ) ;
3332
+
3333
+ let funding_txo_script = funding_redeemscript. to_v0_p2wsh ( ) ;
3334
3334
self . channel_monitor . set_funding_info ( ( funding_txo, funding_txo_script) ) ;
3335
3335
let temporary_channel_id = self . channel_id ;
3336
3336
0 commit comments