Skip to content

Commit

Permalink
txfilter_add_derkey: track p2tr scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
instagibbs committed May 22, 2023
1 parent c2c8b77 commit 656f45e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion wallet/txfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@ void txfilter_add_scriptpubkey(struct txfilter *filter, const u8 *script TAKES)
void txfilter_add_derkey(struct txfilter *filter,
const u8 derkey[PUBKEY_CMPR_LEN])
{
u8 *skp, *p2sh;
u8 *skp, *p2sh, *p2tr;

skp = scriptpubkey_p2wpkh_derkey(tmpctx, derkey);
p2sh = scriptpubkey_p2sh(tmpctx, skp);
p2tr = scriptpubkey_p2tr_derkey(tmpctx, derkey);

txfilter_add_scriptpubkey(filter, take(skp));
txfilter_add_scriptpubkey(filter, take(p2sh));
txfilter_add_scriptpubkey(filter, take(p2tr));
}


Expand Down
2 changes: 1 addition & 1 deletion wallet/txfilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct txfilter *txfilter_new(const tal_t *ctx);
* This ensures that we recognize the scriptpubkeys to our keys when
* filtering transactions. If any of the outputs matches the
* scriptpubkey then the transaction is marked as a match. Adds
* scriptpubkey for both raw p2wpkh and p2wpkh wrapped in p2sh.
* scriptpubkey for taproot, raw p2wpkh and p2wpkh wrapped in p2sh.
*/
void txfilter_add_derkey(struct txfilter *filter,
const u8 derkey[PUBKEY_CMPR_LEN]);
Expand Down

0 comments on commit 656f45e

Please sign in to comment.