log: Properly log txs rejected from mempool
Summary:
Currently CheckTxInputs rejections from the mempool are the only rejections that log directly and unconditionally to debug.log instead of leaving it to the caller. This has multiple issues:
- A rejected RPC transaction will log a redundant failure reason to debug log. All other failures are merely reported to the RPC user.
- A rejected p2p transaction will log the failure twice. Once with the MEMPOOLREJ flag, and once unconditionally.
- A rejected orphan transaction will log no failure.
Fix all issues by simply returning the state to the caller, like it is done for all other rejections.
This is a backport of core#18990
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D9996