aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-03-08 12:08:26 +0000
committerWladimir J. van der Laan <laanwj@gmail.com>2017-04-20 17:15:31 +0200
commit071c95570b8e2ee5c2a4aed8b86b9b14f8e75578 (patch)
tree221b1970c08d70f77b433ca0fc1b3a6457c79f49 /src/wallet/wallet.h
parent71afe3c0995592ff17968816a833a8ed3ce05bf2 (diff)
downloadbitcoin-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.h12
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;