HomePhabricator

log: Properly log txs rejected from mempool

Description

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

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on May 16 2020, 14:40
PiRKCommitted on Aug 31 2021, 19:18
PiRKPushed on Aug 31 2021, 19:18
Reviewer
Restricted Project
Differential Revision
D9996: log: Properly log txs rejected from mempool
Parents
rABC64fe2ca3e453: [Cashtab] Standard component for API error msg
Branches
Unknown
Tags
Unknown