diff --git a/src/gridcoin/voting/result.cpp b/src/gridcoin/voting/result.cpp index 28faee078d..9cbe9dd4eb 100644 --- a/src/gridcoin/voting/result.cpp +++ b/src/gridcoin/voting/result.cpp @@ -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); }