Skip to content

Commit d9a371f

Browse files
committed
f - add docs on panic + add more info on expect in channel reestablish
1 parent 3f142b3 commit d9a371f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lightning/src/ln/channel.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5629,7 +5629,9 @@ impl<SP: Deref> Channel<SP> where
56295629

56305630
let our_commitment_transaction = INITIAL_COMMITMENT_NUMBER - self.context.holder_commitment_point.transaction_number() - 1;
56315631
if msg.next_remote_commitment_number > 0 {
5632-
let expected_point = self.context.holder_signer.as_ref().get_per_commitment_point(INITIAL_COMMITMENT_NUMBER - msg.next_remote_commitment_number + 1, &self.context.secp_ctx).expect("TODO");
5632+
let expected_point = self.context.holder_signer.as_ref()
5633+
.get_per_commitment_point(INITIAL_COMMITMENT_NUMBER - msg.next_remote_commitment_number + 1, &self.context.secp_ctx)
5634+
.expect("TODO: async signing is not yet supported for per commitment points upon channel reestablishment");
56335635
let given_secret = SecretKey::from_slice(&msg.your_last_per_commitment_secret)
56345636
.map_err(|_| ChannelError::close("Peer sent a garbage channel_reestablish with unparseable secret key".to_owned()))?;
56355637
if expected_point != PublicKey::from_secret_key(&self.context.secp_ctx, &given_secret) {

lightning/src/sign/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,10 @@ impl HTLCDescriptor {
725725

726726
/// A trait to handle Lightning channel key material without concretizing the channel type or
727727
/// the signature mechanism.
728+
///
729+
/// Several methods allow error types to be returned to support async signing. This feature
730+
/// is not yet complete, and panics may occur in certain situations when returning errors
731+
/// for these methods.
728732
pub trait ChannelSigner {
729733
/// Gets the per-commitment point for a specific commitment number
730734
///

0 commit comments

Comments
 (0)