Skip to content

Commit aa9b932

Browse files
committed
keystore: simplify _schnorr_keypair
1 parent 1a8cf38 commit aa9b932

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/keystore.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -960,16 +960,13 @@ static bool _schnorr_keypair(
960960
if (!secp256k1_keypair_create(ctx, keypair_out, secret_key)) {
961961
return false;
962962
}
963-
if (!secp256k1_keypair_xonly_pub(ctx, pubkey_out, NULL, keypair_out)) {
964-
return false;
965-
}
966963
if (tweak != NULL) {
967964
if (secp256k1_keypair_xonly_tweak_add(ctx, keypair_out, tweak) != 1) {
968965
return false;
969966
}
970-
if (!secp256k1_keypair_xonly_pub(ctx, pubkey_out, NULL, keypair_out)) {
971-
return false;
972-
}
967+
}
968+
if (!secp256k1_keypair_xonly_pub(ctx, pubkey_out, NULL, keypair_out)) {
969+
return false;
973970
}
974971
return true;
975972
}

0 commit comments

Comments
 (0)