Skip to content

Commit

Permalink
Merge pull request #558 from mxaddict/add-additional-lock-for-cs_main…
Browse files Browse the repository at this point in the history
…-in-rpcwallet

Added an additional LOCK for cs_main
  • Loading branch information
proletesseract committed Jul 7, 2019
2 parents d882683 + b1ad5cd commit ac5df35
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/qt/communityfunddisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ CommunityFundDisplay::CommunityFundDisplay(QWidget *parent, CFund::CProposal pro
}

void CommunityFundDisplay::refresh()
{
{
// Set labels from community fund
ui->title->setText(QString::fromStdString(proposal.strDZeel));
ui->labelStatus->setText(QString::fromStdString(proposal.GetState(pindexBestHeader->GetBlockTime())));
Expand Down Expand Up @@ -188,6 +188,9 @@ void CommunityFundDisplay::refresh()

void CommunityFundDisplay::click_buttonBoxVote(QAbstractButton *button)
{
// Make sure we have a lock when voting
LOCK(cs_main);

// Cast the vote
bool duplicate = false;

Expand Down
3 changes: 3 additions & 0 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3154,6 +3154,9 @@ typedef std::vector<StakePeriodRange_T> vStakePeriodRange_T;
// Check if we have a Tx that can be counted in staking report
bool IsTxCountedAsStaked(const CWalletTx* tx)
{
// Make sure we have a lock
LOCK(cs_main);

// orphan block or immature
if ((!tx->GetDepthInMainChain()) || (tx->GetBlocksToMaturity() > 0))
return false;
Expand Down

0 comments on commit ac5df35

Please sign in to comment.