Page MenuHomePhorge

Add global parameters to AppInit
Open, Needs TriagePublic

Description

AppInit() is the main function that initializes the Bitcoin service. The QT wrapper, and bitcoind wrapper to this function wait on the threadGroup after executing AppInit. So, it seems logical to initialize the following variables outside of AppInit and pass them in:

  • g_mempool
  • chainActive
  • gArgs
  • the config

Then as an interim solution, AppInit should set these globals to point to the appropriate objects.

Event Timeline

schancel updated the task description. (Show Details)

Most of these ex-globals are now members of Node context and passed to AppInitMain via that object.

The remaining global is the config. It would make sense to also make this one a member of the NodeContext.