From f8dcd5ca6f55ad49807cf7491c1f153f6158400e Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 6 Apr 2012 18:39:12 +0200 Subject: Use scoped locks instead of CRITICAL_BLOCK --- src/qt/walletmodel.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/qt/walletmodel.cpp') diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 6cc023792d..9c28a8abc8 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -32,8 +32,8 @@ qint64 WalletModel::getUnconfirmedBalance() const int WalletModel::getNumTransactions() const { int numTransactions = 0; - CRITICAL_BLOCK(wallet->cs_wallet) { + LOCK(wallet->cs_wallet); numTransactions = wallet->mapWallet.size(); } return numTransactions; @@ -115,9 +115,9 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(const QListcs_wallet) { + LOCK2(cs_main, wallet->cs_wallet); + // Sendmany std::vector > vecSend; foreach(const SendCoinsRecipient &rcp, recipients) @@ -155,8 +155,8 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(const QListcs_wallet) { + LOCK(wallet->cs_wallet); if (!wallet->mapAddressBook.count(strAddress)) wallet->SetAddressBookName(strAddress, rcp.label.toStdString()); } @@ -227,8 +227,8 @@ bool WalletModel::setWalletLocked(bool locked, const SecureString &passPhrase) bool WalletModel::changePassphrase(const SecureString &oldPass, const SecureString &newPass) { bool retval; - CRITICAL_BLOCK(wallet->cs_wallet) { + LOCK(wallet->cs_wallet); wallet->Lock(); // Make sure wallet is locked before attempting pass change retval = wallet->ChangeWalletPassphrase(oldPass, newPass); } -- cgit v1.2.3