aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/chain.h
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2017-09-28 14:13:29 -0400
committerRussell Yanofsky <russ@yanofsky.org>2018-11-06 11:44:40 -0400
commitea961c3d7256c66146b4976ab1293db4a628c0de (patch)
treeae47f0f47559d05007ebc63130f3099d9f003a5e /src/interfaces/chain.h
parent8db11dd0b182a93042899651545cc21b34bf0742 (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.h20
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.