Skip to content

Commit ffba0d3

Browse files
committed
comments
1 parent 164af7f commit ffba0d3

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

lightning/src/chain/keysinterface.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,20 @@ pub trait ChannelKeys : Send {
139139
///
140140
/// Note that if signing fails or is rejected, the channel will be force-closed.
141141
///
142+
/// The commitment_tx follows BIP-69 lexicographical ordering.
143+
///
144+
/// The redeem_scripts vector is 1-1 mapped to commitment_tx outputs. For p2wpkh, the
145+
/// redeem script should be empty.
146+
///
142147
/// TODO: Document the things someone using this interface should enforce before signing.
143148
/// TODO: Add more input vars to enable better checking (preferably removing commitment_tx and
144149
/// making the callee generate it via some util function we expose)!
145150
fn sign_remote_commitment<T: secp256k1::Signing>(&self, channel_value_satoshis: u64, channel_funding_redeemscript: &Script, feerate_per_kw: u64, commitment_tx: &Transaction, keys: &TxCreationKeys, htlcs: &[&HTLCOutputInCommitment], to_self_delay: u16, secp_ctx: &Secp256k1<T>, redeem_scripts: &Vec<Script>, remote_per_commitment_point: &PublicKey) -> Result<(Signature, Vec<Signature>), ()>;
146151

147152
/// Create a signature for a (proposed) closing transaction.
148153
///
154+
/// The closing_tx follows BIP-69 lexicographical ordering.
155+
///
149156
/// Note that, due to rounding, there may be one "missing" satoshi, and either party may have
150157
/// chosen to forgo their output as dust.
151158
fn sign_closing_transaction<T: secp256k1::Signing>(&self, channel_value_satoshis: u64, channel_funding_redeemscript: &Script, closing_tx: &Transaction, secp_ctx: &Secp256k1<T>) -> Result<Signature, ()>;

lightning/src/ln/channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
927927
assert!(value_to_self_msat >= 0);
928928
// Note that in case they have several just-awaiting-last-RAA fulfills in-progress (ie
929929
// AwaitingRemoteRevokeToRemove or AwaitingRemovedRemoteRevoke) we may have allowed them to
930-
// "violate" their reserve value by couting those against it. Thus, we have to convert
930+
// "violate" their reserve value by counting those against it. Thus, we have to convert
931931
// everything to i64 before subtracting as otherwise we can overflow.
932932
let value_to_remote_msat: i64 = (self.channel_value_satoshis * 1000) as i64 - (self.value_to_self_msat as i64) - (remote_htlc_total_msat as i64) - value_to_self_msat_offset;
933933
assert!(value_to_remote_msat >= 0);

0 commit comments

Comments
 (0)