Skip to content

Commit 5fc079b

Browse files
committed
Call validate_counterparty_revocation on ChannelSigner directly
1 parent ccf9824 commit 5fc079b

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

lightning/src/ln/channel.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5598,17 +5598,8 @@ impl<SP: Deref> FundedChannel<SP> where
55985598
*self.context.next_remote_commitment_tx_fee_info_cached.lock().unwrap() = None;
55995599
}
56005600

5601-
match &self.context.holder_signer {
5602-
ChannelSignerType::Ecdsa(ecdsa) => {
5603-
ecdsa.validate_counterparty_revocation(
5604-
self.context.cur_counterparty_commitment_transaction_number + 1,
5605-
&secret
5606-
).map_err(|_| ChannelError::close("Failed to validate revocation from peer".to_owned()))?;
5607-
},
5608-
// TODO (taproot|arik)
5609-
#[cfg(taproot)]
5610-
_ => todo!()
5611-
};
5601+
self.context.holder_signer.as_ref().validate_counterparty_revocation(self.context.cur_counterparty_commitment_transaction_number + 1, &secret)
5602+
.map_err(|_| ChannelError::close("Failed to validate revocation from peer".to_owned()))?;
56125603

56135604
self.context.commitment_secrets.provide_secret(self.context.cur_counterparty_commitment_transaction_number + 1, msg.per_commitment_secret)
56145605
.map_err(|_| ChannelError::close("Previous secrets did not match new one".to_owned()))?;

0 commit comments

Comments
 (0)