core: warn the user that we're saving state on shutdown

This commit is contained in:
Péter Szilágyi 2018-02-01 18:30:47 +02:00
parent a14bfec36d
commit a4cff48475
No known key found for this signature in database
GPG key ID: E9AE538CEDF8293D

View file

@ -661,6 +661,8 @@ func (bc *BlockChain) Stop() {
// N blocks. // N blocks.
if number := bc.CurrentBlock().NumberU64(); number >= triesInMemory { if number := bc.CurrentBlock().NumberU64(); number >= triesInMemory {
recent := bc.GetBlockByNumber(bc.CurrentBlock().NumberU64() - triesInMemory + 1) recent := bc.GetBlockByNumber(bc.CurrentBlock().NumberU64() - triesInMemory + 1)
log.Info("Writing cached state to disk", "block", recent.Number(), "hash", recent.Hash(), "root", recent.Root())
if err := bc.triedb.Commit(recent.Root()); err != nil { if err := bc.triedb.Commit(recent.Root()); err != nil {
log.Error("Failed to commit recent state trie", "err", err) log.Error("Failed to commit recent state trie", "err", err)
} }