bitcoin/src/rpc
MarcoFalke f63fc53c2a
Merge bitcoin/bitcoin#21767: [Bundle 6/n] Prune g_chainman usage in auxiliary modules
7a799c9c2b index: refactor-only: Reuse CChain ref (Carl Dong)
db33cde80f index: Add chainstate member to BaseIndex (Carl Dong)
f4a47a1feb bench: Use existing chainman in AssembleBlock (Carl Dong)
91226eb917 bench: Use existing NodeContext in DuplicateInputs (Carl Dong)
e6b4aa6eb5 miner: Pass in chainman to RegenerateCommitments (Carl Dong)
9ecade1425 rest: Add GetChainman function and use it (Carl Dong)
fc1c282845 rpc/blockchain: Use existing blockman in gettxoutsetinfo (Carl Dong)

Pull request description:

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

  The first 2 commits are fixups addressing review for the last bundle: #21391

  NEW note:
  1. I have opened #21766 which keeps track of potential improvements where the flaws already existed before the de-globalization work, please post on that issue about these improvements, thanks!

  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`

ACKs for top commit:
  jarolrod:
    ACK  7a799c9
  ariard:
    Code Review ACK 7a799c9
  fjahr:
    re-ACK 7a799c9c2b
  MarcoFalke:
    review ACK 7a799c9c2b 🌠
  ryanofsky:
    Code review ACK 7a799c9c2b. Basically no change since last review except fixed rebase conflicts and a new comment about REST Ensure()
  jamesob:
    conditional ACK 7a799c9c2b ([`jamesob/ackr/21767.1.dongcarl.bundle_6_n_prune_g_chai`](https://github.com/jamesob/bitcoin/tree/ackr/21767.1.dongcarl.bundle_6_n_prune_g_chai))

Tree-SHA512: 531c00ddcb318817457db2812d9a9d930bc664e58e6f7f1c746350732b031dd624270bfa6b9f49d8056aeb6321d973f0e38e4ff914acd6768edd8602c017d10e
2021-06-01 13:34:18 +02:00
..
blockchain.cpp Merge bitcoin/bitcoin#21767: [Bundle 6/n] Prune g_chainman usage in auxiliary modules 2021-06-01 13:34:18 +02:00
blockchain.h rest/rpc: Remove now-unused old Ensure functions 2021-04-14 11:10:08 -04:00
client.cpp index, rpc: Add use_index option for gettxoutsetinfo 2021-04-19 21:11:33 +02:00
client.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
external_signer.cpp external_signer: remove ExternalSignerException 2021-04-13 20:09:34 +08:00
mining.cpp miner: Pass in chainman to RegenerateCommitments 2021-05-27 13:50:11 -04: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 test: Fix off-by-one in mockscheduler test RPC 2021-05-14 12:49:16 +02:00
net.cpp rpc: simplify addpeeraddress and improve code constness 2021-05-24 14:10:23 +02:00
net.h refactor: Add and use EnsureConnman in rpc code 2021-04-19 13:04:23 +02:00
protocol.h rpc: Add specific error code for "wallet already loaded" 2021-01-25 07:55:35 +01:00
rawtransaction.cpp [rpc] allow multiple txns in testmempoolaccept 2021-05-24 15:45:01 +01: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 Move external signer out of wallet module 2021-04-08 17:56:00 +02:00
request.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
request.h Drop JSONRPCRequest constructors after #21366 2021-04-07 04:53:26 -04:00
server.cpp rpc: Keep default argument value in correct type 2021-04-17 00:22:53 +01:00
server.h Remove pointer cast in CRPCTable::dumpArgMap 2021-01-29 18:15:48 -05:00
util.cpp rpc: enable passing decimals to AmountFromValue, add doxygen 2021-05-09 12:50:00 +02:00
util.h refactor: Remove useless extern keyword 2021-05-10 09:09:24 +02:00