aboutsummaryrefslogtreecommitdiff
path: root/db.cpp
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-10-19 17:16:51 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-10-19 17:16:51 +0000
commit5cbf75324d1509a1262b65c5073314a4da3f6d77 (patch)
treefcaaca0e6f71362c3968735b29ea8e2e7fff9dbb /db.cpp
parent2fad3d34b7b9bf03d56970cb36d9a091609b10c8 (diff)
Gavin's TEST network as -testnet switch, misc fixes
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@168 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'db.cpp')
-rw-r--r--db.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/db.cpp b/db.cpp
index 336d5a5ec0..e606e5d79d 100644
--- a/db.cpp
+++ b/db.cpp
@@ -846,10 +846,13 @@ void BackupWallet(const string& strDest)
}
}
+
void CWalletDB::ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool)
{
nIndex = -1;
keypool.vchPubKey.clear();
+ CRITICAL_BLOCK(cs_main)
+ CRITICAL_BLOCK(cs_mapWallet)
CRITICAL_BLOCK(cs_setKeyPool)
{
// Top up key pool
@@ -881,7 +884,11 @@ void CWalletDB::ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool)
void CWalletDB::KeepKey(int64 nIndex)
{
// Remove from key pool
- Erase(make_pair(string("pool"), nIndex));
+ CRITICAL_BLOCK(cs_main)
+ CRITICAL_BLOCK(cs_mapWallet)
+ {
+ Erase(make_pair(string("pool"), nIndex));
+ }
printf("keypool keep %"PRI64d"\n", nIndex);
}