57d5246c2d
b7b9f6e4cee262004643e2fe03d56cb47fdbf5c2 Remove p2pEnabled from Chain interface (Antoine Riard)
Pull request description:
RPC server starts in warmup mode, it can't process yet calls, then follows connection manager initialization and finally RPC server get out of warmup mode. RPC calls shouldn't be able to get P2P disabled errors because once we initialize g_connman it's not unset until shutdown, after RPC server has been stopped.
@mzumsande comment in #15713 let me thought that `p2pEnabled` was maybe useless, `g_connman` is always initialized before RPC server is getting out of warmup. These checks against P2P state were introduced in
|
||
---|---|---|
.. | ||
chain.cpp | ||
chain.h | ||
handler.cpp | ||
handler.h | ||
node.cpp | ||
node.h | ||
README.md | ||
wallet.cpp | ||
wallet.h |
Internal c++ interfaces
The following interfaces are defined here:
-
Chain
— used by wallet to access blockchain and mempool state. Added in #14437, #14711, #15288, and #10973. -
ChainClient
— used by node to start & stopChain
clients. Added in #14437. -
Node
— used by GUI to start & stop bitcoin node. Added in #10244. -
Handler
— returned byhandleEvent
methods on interfaces above and used to manage lifetimes of event handlers. -
Init
— used by multiprocess code to access interfaces above on startup. Added in #10102.
The interfaces above define boundaries between major components of bitcoin code (node, wallet, and gui), making it possible for them to run in different processes, and be tested, developed, and understood independently. These interfaces are not currently designed to be stable or to be used externally.