Additional, more informative routes (#1204)
* Have reward set updater run its own timer (#1200) * Have reward set updater run its own timer * Filter rocket log spam * Take last day of uptime for rewarding (#1202) * Take last day of uptime for rewarding * Rejigger calculations * Blacklist based on last 24 hr * Cleanup * Clippy * Additional, more informative routes * Improve blacklist updates * Fix rewards estimation
This commit is contained in:
@@ -25,6 +25,15 @@ impl Uptime {
|
||||
Uptime(0)
|
||||
}
|
||||
|
||||
pub fn new(uptime: f32) -> Self {
|
||||
if uptime > 100f32 {
|
||||
error!("Got uptime {}, max is 100, returning 0", uptime);
|
||||
Uptime(0)
|
||||
} else {
|
||||
Uptime(uptime as u8)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_ratio(numerator: usize, denominator: usize) -> Result<Self, InvalidUptime> {
|
||||
if denominator == 0 {
|
||||
return Ok(Self::zero());
|
||||
|
||||
Reference in New Issue
Block a user