Commit c41d8c17 authored by Volodymyr Shamray's avatar Volodymyr Shamray

Remove locks that can potentially deadlock

parent bdaefb53
Pipeline #846 passed with stage
in 137 minutes and 39 seconds
......@@ -196,8 +196,6 @@ void CBudgetManager::CheckOrphanVotes()
void CBudgetManager::SubmitBudgetDraft()
{
LOCK(cs);
static int nSubmittedHeight = 0; // height at which final budget was submitted last time
int nCurrentHeight;
......@@ -345,8 +343,6 @@ void CBudgetManager::SubmitBudgetDraft()
bool CBudgetManager::AddBudgetDraft(const BudgetDraft &budgetDraft, bool checkCollateral)
{
LOCK(cs);
std::string strError = "";
if(!budgetDraft.IsValid(strError, checkCollateral))
return false;
......@@ -379,8 +375,6 @@ bool CBudgetManager::AddProposal(const CBudgetProposal& budgetProposal, bool che
void CBudgetManager::CheckAndRemove()
{
LOCK(cs);
LogPrintf("CBudgetManager::CheckAndRemove\n");
std::string strError = "";
......@@ -846,8 +840,6 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, const std::string& strCommand,
if(fLiteMode) return;
if(!masternodeSync.IsBlockchainSynced()) return;
LOCK(cs);
if (strCommand == "mnvs") { //Masternode vote sync
uint256 nProp;
vRecv >> nProp;
......@@ -2004,7 +1996,7 @@ bool BudgetDraft::IsValid(std::string& strError, bool fCheckCollateral) const
if(m_blockStart == 0) {strError = "Invalid BlockStart == 0"; return false;}
//can only pay out 10% of the possible coins (min value of coins)
if(GetTotalPayout() > budget.GetTotalBudget(m_blockStart)) {strError = "Invalid Payout (more than max)"; return false;}
if(GetTotalPayout() > CBudgetManager::GetTotalBudget(m_blockStart)) {strError = "Invalid Payout (more than max)"; return false;}
std::string strError2 = "";
if(fCheckCollateral && !m_feeTransactionHash.IsNull()){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment