Skip to content

Commit

Permalink
Do not check cumulative before FCC (#1559)
Browse files Browse the repository at this point in the history
Co-authored-by: Prasanna Loganathar <[email protected]>
  • Loading branch information
Bushstar and prasannavl authored Nov 14, 2022
1 parent 01a44aa commit 409bf5e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/masternodes/mn_checks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2182,7 +2182,7 @@ class CCustomTxApplyVisitor : public CCustomTxVisitor
}

// Validate GovVariables before storing
if (obj.govVar->GetName() == "ATTRIBUTES") {
if (height >= static_cast<uint32_t>(consensus.FortCanningCrunchHeight) && obj.govVar->GetName() == "ATTRIBUTES") {

auto govVar = mnview.GetAttributes();
if (!govVar) {
Expand All @@ -2195,10 +2195,8 @@ class CCustomTxApplyVisitor : public CCustomTxVisitor
CCustomCSView govCache(mnview);
for (const auto& [varHeight, var] : storedGovVars) {
if (var->GetName() == "ATTRIBUTES") {
if (!(res = govVar->Import(var->Export())) ||
!(res = govVar->Validate(govCache)) ||
!(res = govVar->Apply(govCache, varHeight))) {
return Res::Err("%s: Cumulative application of Gov vars failed: %s", obj.govVar->GetName(), res.msg);
if (res = govVar->Import(var->Export()); !res) {
return Res::Err("%s: Failed to import stored vars: %s", obj.govVar->GetName(), res.msg);
}
}
}
Expand Down

0 comments on commit 409bf5e

Please sign in to comment.