Skip to content

Commit a016bb1

Browse files
committed
Improve documentation for validate_holder_commitment and sign_counterparty_commitment
1 parent 181d319 commit a016bb1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lightning/src/chain/keysinterface.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ pub trait BaseSign {
216216
///
217217
/// This is required in order for the signer to make sure that releasing a commitment
218218
/// secret won't leave us without a broadcastable holder transaction.
219+
/// Policy checks should be implemented in this function, including checking the amount
220+
/// sent to us and checking the HTLCs.
219221
fn validate_holder_commitment(&self, holder_tx: &HolderCommitmentTransaction);
220222
/// Gets the holder's channel public keys and basepoints
221223
fn pubkeys(&self) -> &ChannelPublicKeys;
@@ -227,6 +229,9 @@ pub trait BaseSign {
227229
/// Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
228230
///
229231
/// Note that if signing fails or is rejected, the channel will be force-closed.
232+
///
233+
/// Policy checks should be implemented in this function, including checking the amount
234+
/// sent to us and checking the HTLCs.
230235
//
231236
// TODO: Document the things someone using this interface should enforce before signing.
232237
fn sign_counterparty_commitment(&self, commitment_tx: &CommitmentTransaction, secp_ctx: &Secp256k1<secp256k1::All>) -> Result<(Signature, Vec<Signature>), ()>;

0 commit comments

Comments
 (0)