0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-04 10:07:27 -05:00
bitcoin-bitcoin-core/src/rpc
Wladimir J. van der Laan 3c40bc6726
Merge #15921: validation: Tidy up ValidationState interface
3004d5a12d [validation] Remove fMissingInputs from AcceptToMemoryPool() (John Newbery)
c428622a5b [validation] Remove unused first_invalid parameter from ProcessNewBlockHeaders() (John Newbery)
7204c6434b [validation] Remove useless ret parameter from Invalid() (John Newbery)
1a37de4b31 [validation] Remove error() calls from Invalid() calls (John Newbery)
067981e492 [validation] Tidy Up ValidationResult class (John Newbery)
a27a2957ed [validation] Add CValidationState subclasses (John Newbery)

Pull request description:

  Carries out some remaining tidy-ups remaining after PR 15141:

  - split ValidationState into TxValidationState and BlockValidationState (commit from ajtowns)
  - various minor code style tidy-ups to the ValidationState class
  - remove the useless `ret` parameter from `ValidationState::Invalid()`
  - remove the now unused `first_invalid` parameter from `ProcessNewBlockHeaders()`
  - remove the `fMissingInputs` parameter from `AcceptToMemoryPool()`, and deal with missing inputs the same way as other errors by using the `TxValidationState` object.

  Tip for reviewers (thanks ryanofsky!): The first commit ("[validation] Add CValidationState subclasses" ) is huge and can be easier to start reviewing if you revert the rote, mechanical changes:

  Substitute the commit hash of commit "[validation] Add CValidationState subclasses" for <CommitHash> in the commands below.

  ```sh
  git checkout <CommitHash>
  git grep -l ValidationState | xargs sed -i 's/BlockValidationState\|TxValidationState/CValidationState/g'
  git grep -l ValidationResult | xargs sed -i 's/BlockValidationResult\|TxValidationResult/ValidationInvalidReason/g'
  git grep -l MaybePunish | xargs sed -i 's/MaybePunishNode\(ForBlock\|ForTx\)/MaybePunishNode/g'
  git diff HEAD^
  ```

  After that it's possible to easily see the mechanical changes with:

  ```sh
  git log -p -n1 -U0 --word-diff-regex=. <CommitHash>
  ```

ACKs for top commit:
  laanwj:
    ACK 3004d5a12d
  amitiuttarwar:
    code review ACK 3004d5a12d. Also built & ran tests locally.
  fjahr:
    Code review ACK 3004d5a12d . Only nit style change and pure virtual destructor added since my last review.
  ryanofsky:
    Code review ACK 3004d5a12d. Just whitespace change and pure virtual destructor added since last review.

Tree-SHA512: 511de1fb380a18bec1944ea82b513b6192df632ee08bb16344a2df3c40811a88f3872f04df24bc93a41643c96c48f376a04551840fd804a961490d6c702c3d36
2019-10-30 15:37:34 +01:00
..
blockchain.cpp Merge #15921: validation: Tidy up ValidationState interface 2019-10-30 15:37:34 +01:00
blockchain.h Avoid using g_rpc_node global in wallet code 2019-10-28 10:30:51 -04:00
client.cpp rpc: Add generatetodescriptor 2019-10-30 10:01:32 -04:00
client.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
mining.cpp Merge #15921: validation: Tidy up ValidationState interface 2019-10-30 15:37:34 +01:00
misc.cpp util: Add CHECK_NONFATAL and use it in src/rpc 2019-10-18 17:19:36 -04:00
net.cpp Avoid using g_rpc_node global in wallet code 2019-10-28 10:30:51 -04:00
protocol.h rpc: migrate JSONRPCRequest functionality into request.cpp 2019-07-05 11:22:02 +09:00
rawtransaction.cpp Merge #15921: validation: Tidy up ValidationState interface 2019-10-30 15:37:34 +01:00
rawtransaction_util.cpp doc: Fix doxygen comment for SignTransaction in rpc/rawtransaction_util 2019-09-19 13:34:50 -04:00
rawtransaction_util.h doc: Fix doxygen comment for SignTransaction in rpc/rawtransaction_util 2019-09-19 13:34:50 -04:00
register.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
request.cpp rpc: migrate JSONRPCRequest functionality into request.cpp 2019-07-05 11:22:02 +09:00
request.h rpc: migrate JSONRPCRequest functionality into request.cpp 2019-07-05 11:22:02 +09:00
server.cpp Remove unused includes 2019-10-15 22:56:43 +00:00
server.h Remove unused includes 2019-10-15 22:56:43 +00:00
util.cpp Avoid using g_rpc_node global in wallet code 2019-10-28 10:30:51 -04:00
util.h Avoid using g_rpc_node global in wallet code 2019-10-28 10:30:51 -04:00