Skip to content

Commit

Permalink
keystore: simplify _schnorr_keypair
Browse files Browse the repository at this point in the history
  • Loading branch information
benma committed Sep 24, 2024
1 parent 1a8cf38 commit aa9b932
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/keystore.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit aa9b932

Please sign in to comment.