Skip to content

Commit 988647d

Browse files
committed
f also doc the new splicing logic
1 parent ae65bce commit 988647d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lightning/src/sign/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ pub(crate) const P2WPKH_WITNESS_WEIGHT: u64 = 1 /* num stack items */ +
141141
pub(crate) const P2TR_KEY_PATH_WITNESS_WEIGHT: u64 = 1 /* witness items */
142142
+ 1 /* schnorr sig len */ + 64 /* schnorr sig */;
143143

144-
/// If a [`KeysManager`] is built with [`KeysManager::new`] with `v2_remote_key_derivation` set,
145-
/// the script which we receive funds to on-chain when our counterparty force-closes a channel is
146-
/// one of this many possible derivation paths.
144+
/// If a [`KeysManager`] is built with [`KeysManager::new`] with `v2_remote_key_derivation` set
145+
/// (and for all channels after they've been spliced), the script which we receive funds to on-chain
146+
/// when our counterparty force-closes a channel is one of this many possible derivation paths.
147147
///
148148
/// Keeping this limited allows for scanning the chain to find lost funds if our state is destroyed,
149149
/// while this being more than a handful provides some privacy by not constantly reusing the same
@@ -1451,6 +1451,8 @@ impl ChannelSigner for InMemorySigner {
14511451
fn new_pubkeys(
14521452
&self, splice_parent_funding_txid: Option<Txid>, secp_ctx: &Secp256k1<secp256k1::All>,
14531453
) -> ChannelPublicKeys {
1454+
// Because splices always break downgrades, we go ahead and always use the new derivation
1455+
// here as its just much better.
14541456
let use_v2_derivation =
14551457
self.v2_remote_key_derivation || splice_parent_funding_txid.is_some();
14561458
let payment_key =

0 commit comments

Comments
 (0)