bitcoin/src/rpc
Wladimir J. van der Laan 702cfc8c53
Merge #21055: [Bundle 3/n] Prune remaining g_chainman usage in validation functions
e11b649650 validation: CVerifyDB::VerifyDB: Use locking annotation (Carl Dong)
03f75c42e1 validation: Use existing chain member in CChainState::LoadGenesisBlock (Carl Dong)
5e4af77380 validation: Use existing chain member in CChainState::AcceptBlock (Carl Dong)
fee73347c0 validation: Pass in chain to FindBlockPos+SaveBlockToDisk (Carl Dong)
a9d28bcd8d validation: Use *this in CChainState::ActivateBestChainStep (Carl Dong)
4744efc9ba validation: Pass in chainstate to CTxMemPool::check (Carl Dong)
1fb7b2c595 validation: Use *this in CChainState::InvalidateBlock (Carl Dong)
8cdb2f7e58 validation: Move LoadBlockIndexDB to CChainState (Carl Dong)
8b99efbcc0 validation: Move invalid block handling to CChainState (Carl Dong)
2bdf37fe18 validation: Pass in chainstate to CVerifyDB::VerifyDB (Carl Dong)
31eac50c72 validation: Remove global ::VersionBitsTip{State,SinceHeight,Statistics} (Carl Dong)
63e4c7316a validation: Pass in chainstate to ::PruneBlockFilesManual (Carl Dong)
4bada76237 validation: Pass in chainstate to UpdateTip (Carl Dong)
a3ba08ba7d validation: Remove global ::{{Precious,Invalidate}Block,ResetBlockFailureFlags} (Carl Dong)
4927c9e699 validation: Remove global ::LoadGenesisBlock (Carl Dong)
9da106be4d validation: Check chain tip is non-null in CheckFinalTx (Carl Dong)

Pull request description:

  Overall PR: #20158 (tree-wide: De-globalize ChainstateManager)

  Based on:
  - [x] #20750 | [Bundle 2/n] Prune g_chainman usage in mempool-related validation functions

  Note to reviewers:
  1. This bundle may _apparently_ introduce usage of `g_chainman` or `::Chain(state|)Active()` globals, but these are resolved later on in the overall PR. [Commits of overall PR](https://github.com/bitcoin/bitcoin/pull/20158/commits)
  2. There may be seemingly obvious local references to `ChainstateManager` or other validation objects which are not being used in callers of the current function in question, this is done intentionally to **_keep each commit centered around one function/method_** to ease review and to make the overall change systematic. We don't assume anything about our callers. Rest assured that once we are considering that particular caller in later commits, we will use the obvious local references. [Commits of overall PR](https://github.com/bitcoin/bitcoin/pull/20158/commits)
  3. When changing a function/method that has many callers (e.g. `LookupBlockIndex` with 55 callers), it is sometimes easier (and less error-prone) to use a scripted-diff. When doing so, there will be 3 commits in sequence so that every commit compiles like so:
  1. Add `new_function`, make `old_function` a wrapper of `new_function`, divert all calls to `old_function` to `new_function` **in the local module only**
  2. Scripted-diff to divert all calls to `old_function` to `new_function` **in the rest of the codebase**
  3. Remove `old_function`

  Note to self:
  - [x] Address: https://github.com/bitcoin/bitcoin/pull/20750#discussion_r579400663

ACKs for top commit:
  laanwj:
    Code review ACK e11b649650

Tree-SHA512: 205a451a741e32f17d5966de289f2f5a3f0817738c0087b70ff4755ddd217b53d01050ed396669bda2b1d216a88d927b9778777f9ff95ab1fe20e59c5f341776
2021-03-04 14:55:47 +01:00
..
blockchain.cpp Merge #21055: [Bundle 3/n] Prune remaining g_chainman usage in validation functions 2021-03-04 14:55:47 +01:00
blockchain.h move-onlyish: break out CreateUTXOSnapshot from dumptxoutset 2021-02-12 07:53:34 -06:00
client.cpp rpc: add external_signer option to createwallet 2021-02-23 14:34:31 +01:00
client.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
mining.cpp Merge #20749: [Bundle 1/n] Prune g_chainman usage related to ::LookupBlockIndex 2021-02-01 13:09:46 +01:00
mining.h rpc: create rpc/mining.h, hoist default max tries values to constant 2020-06-01 15:08:36 +02:00
misc.cpp Merge #18466: rpc: fix invalid parameter error codes for {sign,verify}message RPCs 2021-03-01 11:45:42 +01:00
net.cpp Change all ping times to std::chrono types 2021-03-03 09:48:07 -08:00
protocol.h rpc: Add specific error code for "wallet already loaded" 2021-01-25 07:55:35 +01:00
rawtransaction.cpp scripted-diff: Invoke ::AcceptToMemoryPool with chainstate 2021-02-18 14:49:06 -05:00
rawtransaction_util.cpp Don't make "in" parameters look like "out"/"in-out" parameters: pass by ref to const instead of ref to non-const 2020-12-06 00:22:40 +00:00
rawtransaction_util.h Don't make "in" parameters look like "out"/"in-out" parameters: pass by ref to const instead of ref to non-const 2020-12-06 00:22:40 +00:00
register.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
request.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
request.h scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
server.cpp rpc: Remove duplicate name and argNames from CRPCCommand 2021-01-28 08:19:52 +01:00
server.h rpc: Remove duplicate name and argNames from CRPCCommand 2021-01-28 08:19:52 +01:00
util.cpp Merge #19145: Add hash_type MUHASH for gettxoutsetinfo 2021-02-12 10:47:41 +01:00
util.h Merge #19145: Add hash_type MUHASH for gettxoutsetinfo 2021-02-12 10:47:41 +01:00