Prep so we can pass RPCServer (doesn't exist yet) through the HTTP callbacks system.
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- httpserver
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 3104 Build 4295: Bitcoin ABC Buildbot (legacy) Build 4294: arc lint + arc unit
Event Timeline
src/httpserver.cpp | ||
---|---|---|
386 ↗ | (On Diff #4534) | Why is this a global? Can't we just pass it into initHTTPServer from AppInit() or main() |
I do not get why httpCallbackArgs need to passed around everywhere ? It seems like it's completely unnecessary in many places and redundant with the config.
src/init.cpp | ||
---|---|---|
1115 | Do not pass both config and HTTPCallbackArgs, there is redundant info in there. | |
src/init.h | ||
9 | You only manipulate HTTPCallbackArgs by ref, so just forward declare. |
src/httpserver.cpp | ||
---|---|---|
386 ↗ | (On Diff #4534) | Following the call chain, it's something like this: // init.cpp (this is fine): InitHTTPServer() <- AppInitServers() <- AppInitMain() // bitcoind.cpp (this is fine): AppInitMain() <- AppInit() // qt/bitcoin.cpp (this is where things start to get messy): AppInitMain() <- initialize() // which is called from this in the same file: connect(this, SIGNAL(requestedInitialize(Config *)), executor, SLOT(initialize(Config *))); I made the choice to not modify too much of the qt wallet code, as it's likely to add a lot of dev time to refactoring the RPC server code. Let me know what you think. |
src/init.cpp | ||
1115 | We cleared this up offline. It appears redundant, but removing one or the other breaks encapsulation. The HTTP code uses config, but should not have to dip into the HTTPCallbackArgs to find them. HTTPCallbackArgs is constructed only for the the HTTP callbacks and no other purpose. |