diff options
| author | Luke Dashjr <[email protected]> | 2016-09-09 08:42:30 +0000 |
|---|---|---|
| committer | Luke Dashjr <[email protected]> | 2017-06-06 21:17:09 +0000 |
| commit | b124cf04ea47e1eda60bbc26a9690a9715c6b23f (patch) | |
| tree | a6efe783bcbcf8b37736d20de0aa365ae352e161 /src/wallet/db.h | |
| parent | CWalletDB: Store the update counter per wallet (diff) | |
| download | discoin-b124cf04ea47e1eda60bbc26a9690a9715c6b23f.tar.xz discoin-b124cf04ea47e1eda60bbc26a9690a9715c6b23f.zip | |
Wallet: Replace pwalletMain with a vector of wallet pointers
Diffstat (limited to 'src/wallet/db.h')
| -rw-r--r-- | src/wallet/db.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/wallet/db.h b/src/wallet/db.h index 1a583c3ce..a2ede99d1 100644 --- a/src/wallet/db.h +++ b/src/wallet/db.h @@ -93,13 +93,13 @@ class CWalletDBWrapper friend class CDB; public: /** Create dummy DB handle */ - CWalletDBWrapper(): env(nullptr) + CWalletDBWrapper() : nLastSeen(0), nLastFlushed(0), nLastWalletUpdate(0), env(nullptr) { } /** Create DB handle to real database */ - CWalletDBWrapper(CDBEnv *env_in, const std::string &strFile_in): - env(env_in), strFile(strFile_in) + CWalletDBWrapper(CDBEnv *env_in, const std::string &strFile_in) : + nLastSeen(0), nLastFlushed(0), nLastWalletUpdate(0), env(env_in), strFile(strFile_in) { } @@ -120,13 +120,16 @@ public: void Flush(bool shutdown); void IncrementUpdateCounter(); - unsigned int GetUpdateCounter(); + + std::atomic<unsigned int> nUpdateCounter; + unsigned int nLastSeen; + unsigned int nLastFlushed; + int64_t nLastWalletUpdate; private: /** BerkeleyDB specific */ CDBEnv *env; std::string strFile; - std::atomic<unsigned int> nUpdateCounter; /** Return whether this database handle is a dummy for testing. * Only to be used at a low level, application should ideally not care |