diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2017-09-28 14:13:29 -0400 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2018-11-06 11:44:40 -0400 |
commit | ea961c3d7256c66146b4976ab1293db4a628c0de (patch) | |
tree | ae47f0f47559d05007ebc63130f3099d9f003a5e /src/interfaces/chain.h | |
parent | 8db11dd0b182a93042899651545cc21b34bf0742 (diff) |
Remove direct node->wallet calls in init.cpp
Route calls during node initialization and shutdown that would happen between a
node process and wallet processes through the serializable `Chain::Client`
interface, rather than `WalletInitInterface` which is now simpler and only
deals with early initialization and parameter interaction.
This commit mostly does not change behavior. The only change is that the
"Wallet disabled!" and "No wallet support compiled in!" messages are now logged
earlier during startup.
Diffstat (limited to 'src/interfaces/chain.h')
-rw-r--r-- | src/interfaces/chain.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h index 8a40cb4cda..30bc9f5f73 100644 --- a/src/interfaces/chain.h +++ b/src/interfaces/chain.h @@ -9,6 +9,8 @@ #include <string> #include <vector> +class CScheduler; + namespace interfaces { //! Interface for giving wallet processes access to blockchain state. @@ -24,6 +26,24 @@ class ChainClient { public: virtual ~ChainClient() {} + + //! Register rpcs. + virtual void registerRpcs() = 0; + + //! Check for errors before loading. + virtual bool verify() = 0; + + //! Load saved state. + virtual bool load() = 0; + + //! Start client execution and provide a scheduler. + virtual void start(CScheduler& scheduler) = 0; + + //! Save state to disk. + virtual void flush() = 0; + + //! Shut down client. + virtual void stop() = 0; }; //! Return implementation of Chain interface. |