| 222 | } |
| 223 | |
| 224 | u8 *p2tr_for_keyidx(const tal_t *ctx, struct lightningd *ld, u64 keyidx) |
| 225 | { |
| 226 | struct pubkey shutdownkey; |
| 227 | |
| 228 | /* Use BIP86 derivation if wallet has BIP86 base, otherwise use BIP32 */ |
| 229 | if (ld->bip86_base) { |
| 230 | bip86_pubkey(ld, &shutdownkey, keyidx); |
| 231 | } else { |
| 232 | bip32_pubkey(ld, &shutdownkey, keyidx); |
| 233 | } |
| 234 | |
| 235 | return scriptpubkey_p2tr(ctx, &shutdownkey); |
| 236 | } |
| 237 | |
| 238 | /* BOLT #2: |
| 239 | * A node: |
no test coverage detected