As discussed in #1609 this PR will use EXIT_{success, failure} codes instead of magic numbers in the return statements.
If it looks good I will continue to remove the asserts too in another commit.
As discussed in #1609 this PR will use EXIT_{success, failure} codes instead of magic numbers in the return statements.
If it looks good I will continue to remove the asserts too in another commit.
If it looks good I will continue to remove the asserts too in another commit.
It looks good in principle. But your PR already needs to be rebased now. (Did you accidentally build on an outdated version of master?)
70@@ -70,7 +71,7 @@ static int tweak(const secp256k1_context* ctx, secp256k1_xonly_pubkey *agg_pk, s
71 /* Plain tweaking which, for example, allows deriving multiple child
72 * public keys from a single aggregate key using BIP32 */
73 if (!secp256k1_musig_pubkey_ec_tweak_add(ctx, NULL, cache, plain_tweak)) {
74- return 0;
75+ return EXIT_FAILURE;
EXIT_...
constants are only meant to be used for program termination (i.e. to be returned from main
, or as argument to exit(...)
), not as return codes in our own functions (in this case tweak(...)
)