From f2d9d1a4861d225db39783c7e9fb010d4d1afc52 Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Fri, 21 Sep 2018 10:26:27 -0400 Subject: [PATCH] improve startup bug fix --- ytsync/ytsync.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ytsync/ytsync.go b/ytsync/ytsync.go index e726efd..59c3864 100644 --- a/ytsync/ytsync.go +++ b/ytsync/ytsync.go @@ -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)