From 4106a212ec88ef760f1bf5e5a7e6a2fe99175cb8 Mon Sep 17 00:00:00 2001 From: Sangbida Chaudhuri <101164840+sangbida@users.noreply.github.com> Date: Tue, 13 Jan 2026 22:52:12 +1030 Subject: [PATCH] lightningd: add p2wpkh script for bip86 base A bech32 address can be generated from a bip86 base so we should add both script types (p2wpkh, p2tr) to the txfilter for bip86 bases. --- lightningd/lightningd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index e3eff22d5..aff78fc85 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -691,8 +691,11 @@ static void init_txfilter(struct wallet *w, for (u64 i = 0; i <= bip86_max_index + w->keyscan_gap; i++) { struct pubkey pubkey; bip86_pubkey(w->ld, &pubkey, i); - u8 *script = scriptpubkey_p2tr(tmpctx, &pubkey); - txfilter_add_scriptpubkey(filter, take(script)); + /* Add both P2TR and P2WPKH scripts since BIP86 keys can be used for both */ + u8 *p2tr_script = scriptpubkey_p2tr(tmpctx, &pubkey); + txfilter_add_scriptpubkey(filter, take(p2tr_script)); + u8 *p2wpkh_script = scriptpubkey_p2wpkh(tmpctx, &pubkey); + txfilter_add_scriptpubkey(filter, take(p2wpkh_script)); } } }