0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-09 15:37:00 -04:00
bitcoin-core/src/rpc
Wladimir J. van der Laan 471e5f8829
Merge #16839: Replace Connman and BanMan globals with NodeContext local
362ded410b Avoid using g_rpc_node global in wallet code (Russell Yanofsky)
8922d7f6b7 scripted-diff: Remove g_connman, g_banman globals (Russell Yanofsky)
e6f4f895d5 Pass NodeContext, ConnMan, BanMan references more places (Russell Yanofsky)
4d5448c76b MOVEONLY: Move NodeContext struct to node/context.h (Russell Yanofsky)
301bd41a2e scripted-diff: Rename InitInterfaces to NodeContext (Russell Yanofsky)

Pull request description:

  This change is mainly a naming / organization change intended to simplify #10102. It:

  - Renames struct InitInterfaces to struct NodeContext and moves it from
    src/init.h to src/node/context.h. This is a cosmetic change intended to make
    the point of the struct more obvious.

  - Gets rid of BanMan and ConnMan globals making them NodeContext members
    instead. Getting rid of these globals has been talked about in past as a way
    to implement testing and simulations. Making them NodeContext members is a
    way of keeping them accessible without the globals.

  - Splits g_rpc_interfaces global into g_rpc_node and g_rpc_chain globals. This
    better separates node and wallet rpc methods. Node RPC methods should have
    access NodeContext, while wallet RPC methods should only have indirect access
    to node functionality via interfaces::Chain.

  - Adds NodeContext& references to interfaces::Chain class and the
    interfaces::MakeChain() function. This is needed to access ConnMan and BanMan
    instances without the globals.

  - Gets rid of redundant Node and Chain instances in Qt tests. This is
    needed due to the previous MakeChain change, and also makes test setup a
    little more straightforward. More cleanup could be done in the future, but it
    will require deduplication of bitcoind, bitcoin-qt, and TestingSetup init
    code.

ACKs for top commit:
  laanwj:
    ACK 362ded410b

Tree-SHA512: 9ae6ff1e33423291d1e52056bac95e0874538390892a6e83c4c115b3c73155a8827c0191b46eb3d14e3b3f6c23ccb08095490880fbc3188026319c71739f7db2
2019-10-30 12:35:41 +01:00
..
blockchain.cpp Avoid using g_rpc_node global in wallet code 2019-10-28 10:30:51 -04:00
blockchain.h Avoid using g_rpc_node global in wallet code 2019-10-28 10:30:51 -04:00
client.cpp Remove unused includes 2019-10-15 22:56:43 +00:00
client.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
mining.cpp scripted-diff: Remove g_connman, g_banman globals 2019-10-28 10:30:51 -04: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 #16839: Replace Connman and BanMan globals with NodeContext local 2019-10-30 12:35:41 +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