///
/// Note that if signing fails or is rejected, the channel will be force-closed.
///
+ /// The commitment_tx follows BIP-69 lexicographical ordering.
+ ///
+ /// The redeem_scripts vector is 1-1 mapped to commitment_tx outputs. For p2wpkh, the
+ /// redeem script should be empty.
+ ///
/// TODO: Document the things someone using this interface should enforce before signing.
/// TODO: Add more input vars to enable better checking (preferably removing commitment_tx and
/// making the callee generate it via some util function we expose)!
/// Create a signature for a (proposed) closing transaction.
///
+ /// The closing_tx follows BIP-69 lexicographical ordering.
+ ///
/// Note that, due to rounding, there may be one "missing" satoshi, and either party may have
/// chosen to forgo their output as dust.
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, ()>;
assert!(value_to_self_msat >= 0);
// Note that in case they have several just-awaiting-last-RAA fulfills in-progress (ie
// AwaitingRemoteRevokeToRemove or AwaitingRemovedRemoteRevoke) we may have allowed them to
- // "violate" their reserve value by couting those against it. Thus, we have to convert
+ // "violate" their reserve value by counting those against it. Thus, we have to convert
// everything to i64 before subtracting as otherwise we can overflow.
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;
assert!(value_to_remote_msat >= 0);