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