Skip to content

Commit

Permalink
update import quorum
Browse files Browse the repository at this point in the history
  • Loading branch information
dangell7 committed Dec 11, 2023
1 parent de745da commit e135cf7
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 83 deletions.
14 changes: 10 additions & 4 deletions src/ripple/app/tx/impl/Import.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,6 @@ Import::preflight(PreflightContext const& ctx)
{
auto const& data = (*xpop)[jss::validation][jss::data];
std::set<std::string> used_key;

for (const auto& key : data.getMemberNames())
{
auto nodepub = key;
Expand Down Expand Up @@ -818,11 +817,18 @@ Import::preflight(PreflightContext const& ctx)
<< " validation count: " << validationCount;

// check if the validation count is adequate
if (quorum >= validationCount)
auto hasInsufficientQuorum = [&ctx](int quorum, int validationCount) {
if (ctx.rules.enabled(fixXahauV1)) {
return quorum > validationCount;
} else {
return quorum >= validationCount;
}
};
if (hasInsufficientQuorum(quorum, validationCount))
{
JLOG(ctx.j.warn()) << "Import: xpop did not contain an 80% quorum for "
"the txn it purports to prove. "
<< tx.getTransactionID();
"the txn it purports to prove. "
<< tx.getTransactionID();
return temMALFORMED;
}

Expand Down
Loading

0 comments on commit e135cf7

Please sign in to comment.