Skip to content

Commit aaf8d15

Browse files
committed
qt: Add missing LOCKs for locked coin functions
These don't aquire the wallet lock internally, so the caller has to do it.
1 parent 4757e92 commit aaf8d15

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/qt/walletmodel.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,20 +531,24 @@ void WalletModel::listCoins(std::map<QString, std::vector<COutput> >& mapCoins)
531531

532532
bool WalletModel::isLockedCoin(uint256 hash, unsigned int n) const
533533
{
534+
LOCK(wallet->cs_wallet);
534535
return wallet->IsLockedCoin(hash, n);
535536
}
536537

537538
void WalletModel::lockCoin(COutPoint& output)
538539
{
540+
LOCK(wallet->cs_wallet);
539541
wallet->LockCoin(output);
540542
}
541543

542544
void WalletModel::unlockCoin(COutPoint& output)
543545
{
546+
LOCK(wallet->cs_wallet);
544547
wallet->UnlockCoin(output);
545548
}
546549

547550
void WalletModel::listLockedCoins(std::vector<COutPoint>& vOutpts)
548551
{
552+
LOCK(wallet->cs_wallet);
549553
wallet->ListLockedCoins(vOutpts);
550554
}

0 commit comments

Comments
 (0)