From e6a30a38e9e0764818276fc4cfe9728b1420d1dd Mon Sep 17 00:00:00 2001 From: Lagrang3 <32647090+Lagrang3@users.noreply.github.com> Date: Wed, 10 Jan 2024 11:51:23 +0000 Subject: [PATCH] Update tools/hsmtool.c Co-authored-by: Vincenzo Palazzo --- tools/hsmtool.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/hsmtool.c b/tools/hsmtool.c index fca08fe67ba1..cf14ba3510b7 100644 --- a/tools/hsmtool.c +++ b/tools/hsmtool.c @@ -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). */