File tree 1 file changed +7
-1
lines changed 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -367,6 +367,7 @@ static struct command_result *finish_psbt(struct command *cmd,
367
367
/* Should we add a change output for the excess? */
368
368
if (excess_as_change ) {
369
369
struct amount_sat change ;
370
+ struct pubkey pubkey ;
370
371
s64 keyidx ;
371
372
u8 * b32script ;
372
373
@@ -384,7 +385,12 @@ static struct command_result *finish_psbt(struct command *cmd,
384
385
"Failed to generate change address."
385
386
" Keys exhausted." );
386
387
387
- b32script = p2tr_for_keyidx (tmpctx , cmd -> ld , keyidx );
388
+ if (chainparams -> is_elements ) {
389
+ bip32_pubkey (cmd -> ld , & pubkey , keyidx );
390
+ b32script = scriptpubkey_p2wpkh (tmpctx , & pubkey );
391
+ } else {
392
+ b32script = p2tr_for_keyidx (tmpctx , cmd -> ld , keyidx );
393
+ }
388
394
if (!b32script ) {
389
395
return command_fail (cmd , LIGHTNINGD ,
390
396
"Failed to generate change address."
You can’t perform that action at this time.
0 commit comments