@@ -629,6 +629,7 @@ impl Channel {
629
629
& chan_keys. htlc_base_key , BREAKDOWN_TIMEOUT ,
630
630
keys_provider. get_destination_script ( ) , logger. clone ( ) ) ;
631
631
channel_monitor. set_their_base_keys ( & msg. htlc_basepoint , & msg. delayed_payment_basepoint ) ;
632
+ channel_monitor. provide_their_next_revocation_point ( Some ( ( INITIAL_COMMITMENT_NUMBER , msg. first_per_commitment_point ) ) ) ;
632
633
channel_monitor. set_their_to_self_delay ( msg. to_self_delay ) ;
633
634
634
635
let mut chan = Channel {
@@ -1349,6 +1350,7 @@ impl Channel {
1349
1350
}
1350
1351
1351
1352
self . channel_monitor . set_their_base_keys ( & msg. htlc_basepoint , & msg. delayed_payment_basepoint ) ;
1353
+ self . channel_monitor . provide_their_next_revocation_point ( Some ( ( INITIAL_COMMITMENT_NUMBER , msg. first_per_commitment_point ) ) ) ;
1352
1354
1353
1355
self . their_dust_limit_satoshis = msg. dust_limit_satoshis ;
1354
1356
self . their_max_htlc_value_in_flight_msat = cmp:: min ( msg. max_htlc_value_in_flight_msat , self . channel_value_satoshis * 1000 ) ;
@@ -1496,6 +1498,7 @@ impl Channel {
1496
1498
return Err ( ChannelError :: Close ( "Peer sent a funding_locked at a strange time" ) ) ;
1497
1499
}
1498
1500
1501
+ self . channel_monitor . provide_their_next_revocation_point ( Some ( ( INITIAL_COMMITMENT_NUMBER - 1 , msg. next_per_commitment_point ) ) ) ;
1499
1502
self . their_prev_commitment_point = self . their_cur_commitment_point ;
1500
1503
self . their_cur_commitment_point = Some ( msg. next_per_commitment_point ) ;
1501
1504
Ok ( ( ) )
@@ -1875,7 +1878,8 @@ impl Channel {
1875
1878
return Err ( HandleError { err : "Got a revoke commitment secret which didn't correspond to their current pubkey" , action : None } ) ;
1876
1879
}
1877
1880
}
1878
- self . channel_monitor . provide_secret ( self . cur_remote_commitment_transaction_number + 1 , msg. per_commitment_secret , Some ( ( self . cur_remote_commitment_transaction_number - 1 , msg. next_per_commitment_point ) ) ) ?;
1881
+ self . channel_monitor . provide_secret ( self . cur_remote_commitment_transaction_number + 1 , msg. per_commitment_secret ) ?;
1882
+ self . channel_monitor . provide_their_next_revocation_point ( Some ( ( self . cur_remote_commitment_transaction_number - 1 , msg. next_per_commitment_point ) ) ) ;
1879
1883
1880
1884
// Update state now that we've passed all the can-fail calls...
1881
1885
// (note that we may still fail to generate the new commitment_signed message, but that's
0 commit comments