improve startup

bug fix
This commit is contained in:
Niko Storni 2018-09-21 10:26:27 -04:00
parent 53778a3e4e
commit f2d9d1a486
No known key found for this signature in database
GPG key ID: F37FE63398800368

View file

@ -326,20 +326,20 @@ func (s *Sync) setChannelTerminationStatus(e *error) {
}
func (s *Sync) waitForDaemonStart() error {
for {
select {
case <-s.grp.Ch():
return errors.Err("interrupted during daemon startup")
default:
s, err := s.daemon.Status()
if err == nil && s.StartupStatus.Wallet {
if err == nil && s.StartupStatus.Wallet && s.StartupStatus.FileManager {
return nil
}
time.Sleep(5 * time.Second)
}
}
}
func (s *Sync) stopAndUploadWallet(e *error) {
log.Printf("Stopping daemon")
shutdownErr := stopDaemonViaSystemd()
@ -446,6 +446,10 @@ func (s *Sync) doSync() error {
}
if hasDupes {
SendInfoToSlack("Channel had dupes and was fixed!")
err = s.waitForNewBlock()
if err != nil {
return err
}
claims, err = s.daemon.ClaimListMine()
if err != nil {
return errors.Prefix("cannot list claims: ", err)