diff --git a/manager.go b/manager.go index 35381b8..efd67fc 100644 --- a/manager.go +++ b/manager.go @@ -256,7 +256,7 @@ func (s SyncManager) Start() error { time.Sleep(5 * time.Minute) } for i, sync := range syncs { - SendInfoToSlack("Syncing %s to LBRY! (iteration %d/%d - total session iterations: %d)", sync.LbryChannelName, i, len(syncs), syncCount) + SendInfoToSlack("Syncing %s to LBRY! (iteration %d/%d - total session iterations: %d)", sync.LbryChannelName, i+1, len(syncs), syncCount) err := sync.FullCycle() if err != nil { fatalErrors := []string{ diff --git a/setup.go b/setup.go index f8c6441..def90cd 100644 --- a/setup.go +++ b/setup.go @@ -55,7 +55,7 @@ func (s *Sync) walletSetup() error { //TODO: get rid of this as soon as we compute this condition using the database in a more reliable way if numPublished >= numOnSource { - return errors.Err("channel is already up to date") + return nil } minBalance := (float64(numOnSource)-float64(numPublished))*(publishAmount+0.1) + channelClaimAmount if numPublished > numOnSource { @@ -107,14 +107,6 @@ func (s *Sync) ensureEnoughUTXOs() error { return errors.Err("no response") } - if !allUTXOsConfirmed(utxolist) { - log.Println("Waiting for previous txns to confirm") // happens if you restarted the daemon soon after a previous publish run - err := s.waitUntilUTXOsConfirmed() - if err != nil { - return err - } - } - target := 40 count := 0 @@ -154,6 +146,12 @@ func (s *Sync) ensureEnoughUTXOs() error { if err != nil { return err } + } else if !allUTXOsConfirmed(utxolist) { + log.Println("Waiting for previous txns to confirm") + err := s.waitUntilUTXOsConfirmed() + if err != nil { + return err + } } return nil