Skip to content

Commit

Permalink
Add FCC height check for better code readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Mixa84 committed May 25, 2022
1 parent df09d98 commit cc78ce8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/masternodes/mn_checks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2311,7 +2311,7 @@ class CCustomTxApplyVisitor : public CCustomTxVisitor
if (!HasFoundationAuth())
return Res::Err("tx not from foundation member!");

if (IsTokensMigratedToGovVar())
if (height >= static_cast<uint32_t>(consensus.FortCanningCrunchHeight) && IsTokensMigratedToGovVar())
{
const auto& tokenId = obj.idToken.v;

Expand Down Expand Up @@ -2413,7 +2413,7 @@ class CCustomTxApplyVisitor : public CCustomTxVisitor
if (!tokenId)
return std::move(tokenId);

if (IsTokensMigratedToGovVar())
if (height >= static_cast<uint32_t>(consensus.FortCanningCrunchHeight) && IsTokensMigratedToGovVar())
{
const auto& id = tokenId.val->v;

Expand Down Expand Up @@ -2493,7 +2493,7 @@ class CCustomTxApplyVisitor : public CCustomTxVisitor
if (!pair)
return Res::Err("Loan token (%s) does not exist!", obj.tokenTx.GetHex());

auto loanToken = IsTokensMigratedToGovVar() ?
auto loanToken = (height >= static_cast<uint32_t>(consensus.FortCanningCrunchHeight) && IsTokensMigratedToGovVar()) ?
mnview.GetLoanTokenByID(pair->first) : mnview.GetLoanToken(obj.tokenTx);

if (!loanToken)
Expand All @@ -2518,7 +2518,7 @@ class CCustomTxApplyVisitor : public CCustomTxVisitor
if (!res)
return res;

if (IsTokensMigratedToGovVar())
if (height >= static_cast<uint32_t>(consensus.FortCanningCrunchHeight) && IsTokensMigratedToGovVar())
{
const auto& id = pair->first.v;

Expand Down

0 comments on commit cc78ce8

Please sign in to comment.