@@ -7788,6 +7788,12 @@ impl<SP: Deref> Channel<SP> where
7788
7788
pub fn get_channel_reestablish<L: Deref>(&mut self, logger: &L) -> msgs::ChannelReestablish where L::Target: Logger {
7789
7789
assert!(self.context.channel_state.is_peer_disconnected());
7790
7790
assert_ne!(self.context.cur_counterparty_commitment_transaction_number, INITIAL_COMMITMENT_NUMBER);
7791
+ // This is generally the first function which gets called on any given channel once we're
7792
+ // up and running normally. Thus, we take this opportunity to attempt to resolve the
7793
+ // `holder_commitment_point` to get any keys which we are currently missing.
7794
+ self.context.holder_commitment_point.try_resolve_pending(
7795
+ &self.context.holder_signer, &self.context.secp_ctx, logger,
7796
+ );
7791
7797
// Prior to static_remotekey, my_current_per_commitment_point was critical to claiming
7792
7798
// current to_remote balances. However, it no longer has any use, and thus is now simply
7793
7799
// set to a dummy (but valid, as required by the spec) public key.
@@ -10004,8 +10010,10 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch
10004
10010
// TODO(async_signing): remove this expect with the Uninitialized variant
10005
10011
let current = holder_signer.get_per_commitment_point(cur_holder_commitment_transaction_number, &secp_ctx)
10006
10012
.expect("Must be able to derive the current commitment point upon channel restoration");
10007
- HolderCommitmentPoint::PendingNext {
10008
- transaction_number: cur_holder_commitment_transaction_number, current,
10013
+ let next = holder_signer.get_per_commitment_point(cur_holder_commitment_transaction_number - 1, &secp_ctx)
10014
+ .expect("Must be able to derive the next commitment point upon channel restoration");
10015
+ HolderCommitmentPoint::Available {
10016
+ transaction_number: cur_holder_commitment_transaction_number, current, next,
10009
10017
}
10010
10018
},
10011
10019
};
0 commit comments