Shutdown: do not save peers if we did not become ready

License: MIT
Signed-off-by: Hector Sanjuan <hector@protocol.ai>
This commit is contained in:
Hector Sanjuan 2017-10-30 13:04:30 +01:00
parent 199dbb944a
commit 107ad3bdfc

View File

@ -451,8 +451,11 @@ func (c *Cluster) Shutdown() error {
}
}
// Do not save anything if we were not ready
if c.readyB {
c.peerManager.savePeers()
c.backupState()
}
if err := c.monitor.Shutdown(); err != nil {
logger.Errorf("error stopping monitor: %s", err)