Skip to content

Commit

Permalink
Update tools/hsmtool.c
Browse files Browse the repository at this point in the history
Co-authored-by: Vincenzo Palazzo <[email protected]>
  • Loading branch information
Lagrang3 and vincenzopalazzo authored Jan 10, 2024
1 parent 86b14f1 commit e6a30a3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tools/hsmtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,15 +596,14 @@ static int dumponchaindescriptors(const char *hsm_secret_path,
} while (bip32_key_from_seed(bip32_seed, sizeof(bip32_seed),
version, 0, &master_extkey) != WALLY_OK);

if (show_secrets) {
if (show_secrets)
if (bip32_key_to_base58(&master_extkey, BIP32_FLAG_KEY_PRIVATE,
&enc_xkey) != WALLY_OK)
errx(ERROR_LIBWALLY, "Can't encode xpriv");
} else {
else
if (bip32_key_to_base58(&master_extkey, BIP32_FLAG_KEY_PUBLIC,
&enc_xkey) != WALLY_OK)
errx(ERROR_LIBWALLY, "Can't encode xpub");
}

/* Now we format the descriptor strings (we only ever create P2TR, P2WPKH, and
* P2SH-P2WPKH outputs). */
Expand Down

0 comments on commit e6a30a3

Please sign in to comment.