Closed drcpu-github closed 4 months ago
I think this is the only spot where we need to reset the collateral age of the validator which mined a block. I am not entirely happy with using
self.current_epoch.unwrap_or_default()
, but it should be safe since we would not get here ifcurrent_epoch
wasNone
.
Agreed, it should be fine.
If you want some more peace of mind, a statement like the one around L936 near the start of the function should do it:
let current_epoch = if let Some(epoch) = self.current_epoch {
epoch
} else {
return;
}
I think this is the only spot where we need to reset the collateral age of the validator which mined a block. I am not entirely happy with using
self.current_epoch.unwrap_or_default()
, but it should be safe since we would not get here ifcurrent_epoch
wasNone
.