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
This commit is contained in:
s_nakamoto
2010-10-19 17:16:51 +00:00
parent 2fad3d34b7
commit 5cbf75324d
14 changed files with 155 additions and 82 deletions

9
db.cpp
View File

@@ -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);
}