This code is fine, but I wanted to say something because it's undefined in the spec.

What will probably end up happening is that you check the previous N time of blocks for the host, since there will probably be some forgiveness for hosts that go offline for a few blocks (they lose out on pay and get fined a little, but aren't ejected immediately)

For now, 0 forgiveness is fine.