aboutsummaryrefslogtreecommitdiff
path: root/src/db.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2011-06-01 18:27:05 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2011-06-15 11:05:55 +0200
commite89b9f6a2abaa120ff0fc3cea9ae364e8cbd25e4 (patch)
treeef0789aeadd8ff3e53c2705ea9153f0e612f689c /src/db.h
parent19ea44208f7c2cf335c654126deb81406036e328 (diff)
downloadbitcoin-e89b9f6a2abaa120ff0fc3cea9ae364e8cbd25e4.tar.xz
move wallet code to separate file
This introduces two new source files, keystore.cpp and wallet.cpp with corresponding headers. Code is moved from main and db, in a preparation for a follow-up commit which introduces the classes CWallet and CKeyStore.
Diffstat (limited to 'src/db.h')
-rw-r--r--src/db.h34
1 files changed, 5 insertions, 29 deletions
diff --git a/src/db.h b/src/db.h
index 9826194ed0..577983725b 100644
--- a/src/db.h
+++ b/src/db.h
@@ -25,8 +25,6 @@ class CAccount;
class CAccountingEntry;
class CBlockLocator;
-extern std::map<std::string, std::string> mapAddressBook;
-extern CCriticalSection cs_mapAddressBook;
extern std::vector<unsigned char> vchDefaultKey;
extern bool fClient;
extern int nBestHeight;
@@ -39,6 +37,8 @@ extern DbEnv dbenv;
extern void DBFlush(bool fShutdown);
extern std::vector<unsigned char> GetKeyFromKeyPool();
extern int64 GetOldestKeyPoolTime();
+extern void ThreadFlushWalletDB(void* parg);
+
@@ -494,33 +494,9 @@ public:
ReturnKey();
}
- std::vector<unsigned char> GetReservedKey()
- {
- if (nIndex == -1)
- {
- CKeyPool keypool;
- CWalletDB().ReserveKeyFromKeyPool(nIndex, keypool);
- vchPubKey = keypool.vchPubKey;
- }
- assert(!vchPubKey.empty());
- return vchPubKey;
- }
-
- void KeepKey()
- {
- if (nIndex != -1)
- CWalletDB().KeepKey(nIndex);
- nIndex = -1;
- vchPubKey.clear();
- }
-
- void ReturnKey()
- {
- if (nIndex != -1)
- CWalletDB::ReturnKey(nIndex);
- nIndex = -1;
- vchPubKey.clear();
- }
+ std::vector<unsigned char> GetReservedKey();
+ void KeepKey();
+ void ReturnKey();
};
#endif