aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-04-22 10:01:35 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-04-22 13:35:37 +0200
commit2bbecc84e2f2969e5649fdaeb1a0ca239b03fe44 (patch)
tree31d5a8fb1e30587cdca82618cf17de127d61ee2c /src/wallet.cpp
parente2bff7df08b56d93327ffa998bd2a709f23e6d1f (diff)
parent55a1db4fa2cf62b9766ef382c1e14b3ecbdf67fe (diff)
Merge pull request #4058
55a1db4 Solve chainActive-related locking issues (Wladimir J. van der Laan) e07c943 Add AssertLockHeld for cs_main to ChainActive-using functions (Wladimir J. van der Laan)
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r--src/wallet.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index 03a699a69c..7cf2361096 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -607,7 +607,7 @@ bool CWallet::AddToWalletIfInvolvingMe(const uint256 &hash, const CTransaction&
void CWallet::SyncTransaction(const uint256 &hash, const CTransaction& tx, const CBlock* pblock)
{
- LOCK(cs_wallet);
+ LOCK2(cs_main, cs_wallet);
if (!AddToWalletIfInvolvingMe(hash, tx, pblock, true))
return; // Not one of ours
@@ -835,7 +835,7 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
CBlockIndex* pindex = pindexStart;
{
- LOCK(cs_wallet);
+ LOCK2(cs_main, cs_wallet);
// no need to read and scan block, if block was created before
// our wallet birthday (as adjusted for block time variability)
@@ -870,7 +870,7 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
void CWallet::ReacceptWalletTransactions()
{
- LOCK(cs_wallet);
+ LOCK2(cs_main, cs_wallet);
BOOST_FOREACH(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet)
{
const uint256& wtxid = item.first;
@@ -965,7 +965,7 @@ int64_t CWallet::GetBalance() const
{
int64_t nTotal = 0;
{
- LOCK(cs_wallet);
+ LOCK2(cs_main, cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
{
const CWalletTx* pcoin = &(*it).second;
@@ -981,7 +981,7 @@ int64_t CWallet::GetUnconfirmedBalance() const
{
int64_t nTotal = 0;
{
- LOCK(cs_wallet);
+ LOCK2(cs_main, cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
{
const CWalletTx* pcoin = &(*it).second;
@@ -996,7 +996,7 @@ int64_t CWallet::GetImmatureBalance() const
{
int64_t nTotal = 0;
{
- LOCK(cs_wallet);
+ LOCK2(cs_main, cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
{
const CWalletTx* pcoin = &(*it).second;