lightningd: use bip86 derivation for anchor spend change outputs
This commit is contained in:
committed by
Rusty Russell
parent
bf43fbb7cc
commit
fa96b60113
@@ -276,7 +276,12 @@ static struct wally_psbt *anchor_psbt(const tal_t *ctx,
|
||||
change = chainparams->dust_limit;
|
||||
}
|
||||
|
||||
bip32_pubkey(ld, &final_key, channel->final_key_idx);
|
||||
/* Use BIP86 derivation for P2TR if available, otherwise BIP32 */
|
||||
if (ld->bip86_base) {
|
||||
bip86_pubkey(ld, &final_key, channel->final_key_idx);
|
||||
} else {
|
||||
bip32_pubkey(ld, &final_key, channel->final_key_idx);
|
||||
}
|
||||
psbt_append_output(psbt,
|
||||
scriptpubkey_p2tr(tmpctx, &final_key),
|
||||
change);
|
||||
|
||||
Reference in New Issue
Block a user