Improve genesis service (#1103)

* Update for latest master

* Shift delay inside loop

* Clean up genesis service

* Tidy

* Tidy logs

* Address Michael's comments

* Add pre-genesis logging

* Remove est time till genesis

* Fix time formatting

* Tidy
This commit is contained in:
Paul Hauner
2020-05-26 13:25:52 +10:00
committed by GitHub
parent e889c2eb22
commit 3c52b5c58d
6 changed files with 428 additions and 245 deletions

View File

@@ -167,6 +167,13 @@ impl Service {
&self.inner.deposit_cache
}
/// Removes all blocks from the cache, except for the latest block.
///
/// We don't remove the latest blocks so we don't lose track of the latest block.
pub fn clear_block_cache(&self) {
self.inner.block_cache.write().truncate(1)
}
/// Drop the block cache, replacing it with an empty one.
pub fn drop_block_cache(&self) {
*(self.inner.block_cache.write()) = BlockCache::default();