Skip to content

Commit

Permalink
Collapse vote count messages with results
Browse files Browse the repository at this point in the history
  • Loading branch information
ximinez committed Oct 29, 2024
1 parent aa20add commit 88cd5e4
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/ripple/app/misc/impl/AmendmentTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,11 +864,9 @@ AmendmentTableImpl::doVoting(
majorityTime = it->second;
}

if (enabledAmendments.count(entry.first) == 0)
// Don't bother logging for enabled amendments
JLOG(j_.debug())
<< "Amendment " << entry.first << " (" << entry.second.name
<< ") has " << vote->votes(entry.first) << " votes";
std::stringstream ss;
ss << "Amendment " << entry.first << " (" << entry.second.name
<< ") has " << vote->votes(entry.first) << " votes";

if (enabledAmendments.count(entry.first) != 0)
{
Expand All @@ -888,13 +886,13 @@ AmendmentTableImpl::doVoting(
{
// Ledger says no majority, validators say yes, and voting yes
// locally
JLOG(j_.debug()) << entry.first << ": amendment got majority";
JLOG(j_.debug()) << ss.str() << ": amendment got majority";
actions[entry.first] = tfGotMajority;
}
else if (!hasValMajority && (majorityTime != NetClock::time_point{}))
{
// Ledger says majority, validators say no
JLOG(j_.debug()) << entry.first << ": amendment lost majority";
JLOG(j_.debug()) << ss.str() << ": amendment lost majority";
actions[entry.first] = tfLostMajority;
}
else if (
Expand All @@ -903,20 +901,20 @@ AmendmentTableImpl::doVoting(
entry.second.vote == AmendmentVote::up)
{
// Ledger says majority held
JLOG(j_.debug()) << entry.first << ": amendment majority held";
JLOG(j_.debug()) << ss.str() << ": amendment majority held";
actions[entry.first] = 0;
}
// Logging only below this point
else if (hasValMajority && (majorityTime != NetClock::time_point{}))
{
JLOG(j_.debug())
<< entry.first
<< ss.str()
<< ": amendment holding majority, waiting to be enabled";
}
else if (!hasValMajority)
{
JLOG(j_.debug())
<< entry.first << ": amendment does not have majority";
<< ss.str() << ": amendment does not have majority";
}
}

Expand Down

0 comments on commit 88cd5e4

Please sign in to comment.