Skip to content

Commit ac5df35

Browse files
Merge pull request #558 from mxaddict/add-additional-lock-for-cs_main-in-rpcwallet
Added an additional LOCK for cs_main
2 parents d882683 + b1ad5cd commit ac5df35

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/qt/communityfunddisplay.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ CommunityFundDisplay::CommunityFundDisplay(QWidget *parent, CFund::CProposal pro
4444
}
4545

4646
void CommunityFundDisplay::refresh()
47-
{
47+
{
4848
// Set labels from community fund
4949
ui->title->setText(QString::fromStdString(proposal.strDZeel));
5050
ui->labelStatus->setText(QString::fromStdString(proposal.GetState(pindexBestHeader->GetBlockTime())));
@@ -188,6 +188,9 @@ void CommunityFundDisplay::refresh()
188188

189189
void CommunityFundDisplay::click_buttonBoxVote(QAbstractButton *button)
190190
{
191+
// Make sure we have a lock when voting
192+
LOCK(cs_main);
193+
191194
// Cast the vote
192195
bool duplicate = false;
193196

src/wallet/rpcwallet.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3154,6 +3154,9 @@ typedef std::vector<StakePeriodRange_T> vStakePeriodRange_T;
31543154
// Check if we have a Tx that can be counted in staking report
31553155
bool IsTxCountedAsStaked(const CWalletTx* tx)
31563156
{
3157+
// Make sure we have a lock
3158+
LOCK(cs_main);
3159+
31573160
// orphan block or immature
31583161
if ((!tx->GetDepthInMainChain()) || (tx->GetBlocksToMaturity() > 0))
31593162
return false;

0 commit comments

Comments
 (0)