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:
Drazen Urch
2022-04-12 11:55:32 +02:00
committed by GitHub
parent 25e1bfa345
commit d3372bfc85
21 changed files with 486 additions and 343 deletions
@@ -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());