docs: Clarify that callback can be called more than once #1727

pull real-or-random wants to merge 2 commits into bitcoin-core:master from real-or-random:202508-illegal-twice changing 1 files +18 −16
  1. real-or-random commented at 8:09 am on August 20, 2025: contributor

    The tests in #1698 reminded me that some functions, e.g., secp256k1_ec_pubkey_cmp, may call the illegal callback more than once (see #1390 (review) for more context). This PR clarifies the API docs to state explicitly that this is possible.

    This is the simplest solution. Any production code should crash anyway if it encounters a callback. And in debug code or in our test code, it doesn’t really matter whether you see an error message once or twice.

    The alternative is to provide a guarantee that the callback is called only once. But that would make our code more complex for no good reason.

    The second commit fixes a few typos, wording, and consistency.

  2. docs: Clarify that callback can be called more than once 6b647748f9
  3. doc: Improve API docs of _context_set_illegal_callback d2793799c7
  4. real-or-random added the label user-documentation on Aug 20, 2025
  5. real-or-random added the label tweak/refactor on Aug 20, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-08-30 22:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me