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