Skip to content

Commit

Permalink
MW changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescowens committed Oct 22, 2024
1 parent ddebe66 commit cd44903
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gridcoin/voting/result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1149,9 +1149,11 @@ Fraction ResolveMagnitudeWeightFactorForPoll(const Poll& poll)
Fraction magnitude_weight_factor = Params().GetConsensus().DefaultMagnitudeWeightFactor;

// Find the current protocol entry value for Magnitude Weight Factor, if it exists.
ProtocolEntryOption protocol_entry = GetProtocolRegistry().TryByTimestamp("magnitudeweightfactor", poll.m_timestamp);
ProtocolEntryOption protocol_entry = GetProtocolRegistry().TryLastBeforeTimestamp("magnitudeweightfactor", poll.m_timestamp);

if (protocol_entry != nullptr) {
// If their is an entry prior or equal in timestemp to the start of the poll and it is active then set the magnitude weight
// factor to that value. If the last entry is not active (i.e. deleted), then leave at the default.
if (protocol_entry != nullptr && protocol_entry->m_status == ProtocolEntryStatus::ACTIVE) {
magnitude_weight_factor = Fraction().FromString(protocol_entry->m_value);
}

Expand Down

0 comments on commit cd44903

Please sign in to comment.