diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-03-08 12:08:26 +0000 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-04-20 17:15:31 +0200 |
commit | 071c95570b8e2ee5c2a4aed8b86b9b14f8e75578 (patch) | |
tree | 221b1970c08d70f77b433ca0fc1b3a6457c79f49 /src/wallet/wallet.h | |
parent | 71afe3c0995592ff17968816a833a8ed3ce05bf2 (diff) | |
download | bitcoin-071c95570b8e2ee5c2a4aed8b86b9b14f8e75578.tar.xz |
wallet: Get rid of fFileBacked
Instead, CWalletDB() with a dummy handle will just give you a no-op
database in which writes always succeeds and reads always fail. CDB
already had functionality for this, so just use that.
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r-- | src/wallet/wallet.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 318aa2bf97..8cec04e2e7 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -698,8 +698,6 @@ private: /* HD derive new child key (on internal or external chain) */ void DeriveNewChildKey(CKeyMetadata& metadata, CKey& secret, bool internal = false); - bool fFileBacked; - std::set<int64_t> setKeyPool; int64_t nTimeFirstKey; @@ -720,9 +718,7 @@ private: public: /* * Main wallet lock. - * This lock protects all the fields added by CWallet - * except for: - * fFileBacked (immutable after instantiation) + * This lock protects all the fields added by CWallet. */ mutable CCriticalSection cs_wallet; @@ -765,15 +761,16 @@ public: MasterKeyMap mapMasterKeys; unsigned int nMasterKeyMaxID; - CWallet() + // Create wallet with dummy database handle + CWallet(): dbw(new CWalletDBWrapper()) { SetNull(); } + // Create wallet with passed-in database handle CWallet(std::unique_ptr<CWalletDBWrapper> dbw_in) : dbw(std::move(dbw_in)) { SetNull(); - fFileBacked = true; } ~CWallet() @@ -786,7 +783,6 @@ public: { nWalletVersion = FEATURE_BASE; nWalletMaxVersion = FEATURE_BASE; - fFileBacked = false; nMasterKeyMaxID = 0; pwalletdbEncryption = NULL; nOrderPosNext = 0; |