secp256k1_silentpayments_recipient_prevouts_summary_create and secp256k1_silentpayments_recipient_scan_outputs treated a transaction with no eligible inputs, or no taproot outputs, as an illegal argument. With the default illegal callback, that calls abort().
That contradicts the API documentation. Both functions are documented to return 0 if the transaction is not a Silent Payments transaction, and a transaction with no eligible inputs or no taproot outputs is exactly that case. It also puts the burden on callers. Anyone scanning a block or building an index has to filter these transactions out before calling the library. If they forget, a transaction someone else created can crash their process.
This PR makes both functions return 0 in these cases:
prevouts_summary_create: drops theARG_CHECK((n_pubkeys > 0) || (n_xonly_pubkeys > 0)). With no public keys, the sum is the point at infinity, so the existing "sum is infinity" check already returns 0. No new code path is needed.scan_outputs: drops theARG_CHECK(n_tx_outputs > 0). It returns 0 after all other arguments have been validated and before the scan key is loaded.*n_found_outputsis still set to 0.scan_outputs: tx_outputs and found_outputs are now only checked for NULL ifn_tx_outputs > 0, and theirSECP256K1_ARG_NONNULLattributes are removed. This lets callers pass an empty array as NULL (e.g., data() of an empty std::vector). It matches how prevouts_summary_create and sender_create_outputs already treat empty key arrays (see the previous "Fixed" entry in the CHANGELOG added in PR #1932).