aboutsummaryrefslogtreecommitdiff
path: root/db.h
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-02-12 20:38:44 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-02-12 20:38:44 +0000
commit22f721dbf23cf5ce9e3ded9bcfb65a3894cc0f8c (patch)
tree61624e0903150505dc09977ae9ff1bc9ab40ee2b /db.h
parent73278c0a16cf0d68fb9011203a2112c3499df195 (diff)
downloadbitcoin-22f721dbf23cf5ce9e3ded9bcfb65a3894cc0f8c.tar.xz
command line and JSON-RPC first draft, requires Boost 1.35 or higher for boost::asio,
added SetBitcoinAddress and GetBitcoinAddress methods on CScript, critsect interlocks around mapAddressBook, added some random delays in tx broadcast to improve privacy, now compiles with MSVC 8.0
Diffstat (limited to 'db.h')
-rw-r--r--db.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/db.h b/db.h
index d32d2d5d2f..538076b5aa 100644
--- a/db.h
+++ b/db.h
@@ -1,8 +1,7 @@
-// Copyright (c) 2009 Satoshi Nakamoto
+// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
-#include <db_cxx.h>
class CTransaction;
class CTxIndex;
class CDiskBlockIndex;
@@ -14,6 +13,7 @@ class CAddress;
class CWalletTx;
extern map<string, string> mapAddressBook;
+extern CCriticalSection cs_mapAddressBook;
extern bool fClient;
@@ -359,15 +359,17 @@ public:
bool WriteName(const string& strAddress, const string& strName)
{
+ CRITICAL_BLOCK(cs_mapAddressBook)
+ mapAddressBook[strAddress] = strName;
nWalletDBUpdated++;
- mapAddressBook[strAddress] = strName;
return Write(make_pair(string("name"), strAddress), strName);
}
bool EraseName(const string& strAddress)
{
+ CRITICAL_BLOCK(cs_mapAddressBook)
+ mapAddressBook.erase(strAddress);
nWalletDBUpdated++;
- mapAddressBook.erase(strAddress);
return Erase(make_pair(string("name"), strAddress));
}