Skip to content

Commit

Permalink
remove uneeded invariant
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnxie999 committed Jan 17, 2024
1 parent ded84f8 commit 1f87af0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 1 addition & 10 deletions src/ripple/app/tx/impl/InvariantCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,10 +815,6 @@ ValidMPTIssuance::visitEntry(
mptIssuancesDeleted_++;
else if (!before)
mptIssuancesCreated_++;

if ((*after)[sfOutstandingAmount] >
(*after)[~sfMaximumAmount].value_or(maxMPTokenAmount))
amountExceededMax_ = true;
}

if (after && after->getType() == ltMPTOKEN)
Expand Down Expand Up @@ -966,14 +962,9 @@ ValidMPTIssuance::finalize(
{
JLOG(j.fatal()) << "Invariant failed: a MPToken was deleted";
}
else if (amountExceededMax_)
{
JLOG(j.fatal())
<< "Invariant failed: OutstandingAmount exceeded MaximumAmount";
}

return mptIssuancesCreated_ == 0 && mptIssuancesDeleted_ == 0 &&
mptokensCreated_ == 0 && mptokensDeleted_ == 0 && !amountExceededMax_;
mptokensCreated_ == 0 && mptokensDeleted_ == 0;
}

} // namespace ripple
2 changes: 0 additions & 2 deletions src/ripple/app/tx/impl/InvariantCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,6 @@ class ValidMPTIssuance
std::uint32_t mptokensCreated_ = 0;
std::uint32_t mptokensDeleted_ = 0;

bool amountExceededMax_ = false;

public:
void
visitEntry(
Expand Down

0 comments on commit 1f87af0

Please sign in to comment.