0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-03 09:56:38 -05:00
bitcoin-bitcoin-core/src/util
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
..
bip32.cpp Add WriteHDKeypath function and move *HDKeypath to util/bip32.{h,cpp} 2019-02-14 14:00:28 -05:00
bip32.h Add WriteHDKeypath function and move *HDKeypath to util/bip32.{h,cpp} 2019-02-14 14:00:28 -05:00
bytevectorhash.cpp blockfilter: Use unordered_set instead of set in blockfilter. 2018-11-05 09:30:56 -08:00
bytevectorhash.h blockfilter: Use unordered_set instead of set in blockfilter. 2018-11-05 09:30:56 -08:00
check.h util: Add CHECK_NONFATAL and use it in src/rpc 2019-10-18 17:19:36 -04:00
error.cpp util: Make util/error bilingual_str (refactor) 2019-08-28 15:52:26 -04:00
error.h util: Make util/error bilingual_str (refactor) 2019-08-28 15:52:26 -04:00
fees.cpp [wallet] abort when attempting to fund a transaction above maxtxfee 2019-06-28 22:44:38 -04:00
fees.h [build] Add several util units 2019-04-09 17:53:08 -04:00
macros.h refactor: consolidate PASTE macros 2019-09-25 10:56:00 -04:00
memory.h scripted-diff: Move util files to separate directory. 2018-11-04 22:46:07 -08:00
moneystr.cpp Remove unused includes 2019-10-15 22:56:43 +00:00
moneystr.h Remove unused includes 2019-10-15 22:56:43 +00:00
rbf.cpp [build] Add several util units 2019-04-09 17:53:08 -04:00
rbf.h [build] Add several util units 2019-04-09 17:53:08 -04:00
spanparsing.cpp Abstract out some of the descriptor Span-parsing helpers 2019-09-18 12:12:13 -07:00
spanparsing.h Add documenting comments to spanparsing.h 2019-09-18 12:25:55 -07:00
strencodings.cpp Fix occurences of c_str() used with size() to data() 2019-10-28 13:41:45 +01:00
strencodings.h util: refactor upper/lowercase functions 2019-08-08 11:35:14 +09:00
string.cpp util: Add Join helper to join a list of strings 2019-08-20 16:51:41 -04:00
string.h Remove unused includes 2019-10-15 22:56:43 +00:00
system.cpp refactor: Remove redundant c_str() calls in formatting 2019-10-28 13:31:33 +01:00
system.h Merge #15864: Fix datadir handling 2019-08-19 10:01:30 -04:00
threadnames.cpp Remove unused includes 2019-10-15 22:56:43 +00:00
threadnames.h Don't rename main thread at process level 2019-10-03 06:58:47 +02:00
time.cpp Rename DecodeDumpTime to ParseISO8601DateTime and move to time.cpp 2019-10-27 01:00:05 +03:00
time.h Rename DecodeDumpTime to ParseISO8601DateTime and move to time.cpp 2019-10-27 01:00:05 +03:00
translation.h MOVEONLY: Move key handling code out of wallet to keyman file 2019-10-25 19:20:24 -04:00
url.cpp [build] Add several util units 2019-04-09 17:53:08 -04:00
url.h [build] Add several util units 2019-04-09 17:53:08 -04:00
validation.cpp [validation] Add CValidationState subclasses 2019-10-29 15:46:45 -04:00
validation.h [validation] Add CValidationState subclasses 2019-10-29 15:46:45 -04:00
vector.h Add some general std::vector utility functions 2019-10-16 08:56:57 -07:00