Toggle SAFE syncmode on and off automatically

If monerod is started with default sync mode, set it to SAFE after
synchronization completes. Set it back to FAST if synchronization
restarts (e.g. because another peer has a longer blockchain).

If monerod is started with an explicit sync mode, none of this
automation takes effect.
This commit is contained in:
Howard Chu 2017-08-19 19:36:51 +01:00
parent 4c7f8ac04f
commit 9a859844f4
No known key found for this signature in database
GPG key ID: FD2A70B44AB11BA7
8 changed files with 47 additions and 2 deletions

View file

@ -47,6 +47,7 @@ public:
virtual void open(const std::string& filename, const int db_flags = 0) { }
virtual void close() {}
virtual void sync() {}
virtual void safesyncmode(const bool onoff) {}
virtual void reset() {}
virtual std::vector<std::string> get_filenames() const { return std::vector<std::string>(); }
virtual std::string get_db_name() const { return std::string(); }