mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Merge pull request #359 from UdjinM6/v0.12.0.x_fix_budget_segfault
v0.12.0.x fix segfault in budgets
This commit is contained in:
commit
b2b2e12b10
@ -262,18 +262,15 @@ void CBudgetManager::AddProposal(CBudgetProposal& prop)
|
|||||||
|
|
||||||
void CBudgetManager::CheckAndRemove()
|
void CBudgetManager::CheckAndRemove()
|
||||||
{
|
{
|
||||||
return;
|
|
||||||
|
|
||||||
//segfault happening in the following code sometimes
|
|
||||||
std::map<uint256, CFinalizedBudget>::iterator it = mapFinalizedBudgets.begin();
|
std::map<uint256, CFinalizedBudget>::iterator it = mapFinalizedBudgets.begin();
|
||||||
while(it != mapFinalizedBudgets.end())
|
while(it != mapFinalizedBudgets.end())
|
||||||
{
|
{
|
||||||
CFinalizedBudget* prop = &((*it).second);
|
CFinalizedBudget* prop = &((*it).second);
|
||||||
if(!prop->IsValid()){
|
if(!prop->IsValid()){
|
||||||
mapFinalizedBudgets.erase(it);
|
mapFinalizedBudgets.erase(it++);
|
||||||
} else {
|
} else {
|
||||||
prop->AutoCheck();
|
prop->AutoCheck();
|
||||||
it++;
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,9 +279,9 @@ void CBudgetManager::CheckAndRemove()
|
|||||||
{
|
{
|
||||||
CBudgetProposal* prop = &((*it2).second);
|
CBudgetProposal* prop = &((*it2).second);
|
||||||
if(!prop->IsValid()){
|
if(!prop->IsValid()){
|
||||||
mapProposals.erase(it2);
|
mapProposals.erase(it2++);
|
||||||
} else {
|
} else {
|
||||||
it2++;
|
++it2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user