From aa9b9328ae24512810662fb867f2aa74c0d87b5c Mon Sep 17 00:00:00 2001 From: Marko Bencun Date: Tue, 24 Sep 2024 13:53:02 +0200 Subject: [PATCH] keystore: simplify _schnorr_keypair --- src/keystore.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/keystore.c b/src/keystore.c index 38a5c95ea..f7ddf064c 100644 --- a/src/keystore.c +++ b/src/keystore.c @@ -960,16 +960,13 @@ static bool _schnorr_keypair( if (!secp256k1_keypair_create(ctx, keypair_out, secret_key)) { return false; } - if (!secp256k1_keypair_xonly_pub(ctx, pubkey_out, NULL, keypair_out)) { - return false; - } if (tweak != NULL) { if (secp256k1_keypair_xonly_tweak_add(ctx, keypair_out, tweak) != 1) { return false; } - if (!secp256k1_keypair_xonly_pub(ctx, pubkey_out, NULL, keypair_out)) { - return false; - } + } + if (!secp256k1_keypair_xonly_pub(ctx, pubkey_out, NULL, keypair_out)) { + return false; } return true; }