From 29d50ec0d2a7845eaeba6159325872b326e26cdb Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Wed, 8 Aug 2018 05:55:27 -0400 Subject: [PATCH] fix mysterious bug --- setup.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/setup.go b/setup.go index d3e86ec..c75f0fa 100644 --- a/setup.go +++ b/setup.go @@ -53,12 +53,8 @@ func (s *Sync) walletSetup() error { numOnSource = uint64(s.Manager.VideosLimit) } - //TODO: get rid of this as soon as we compute this condition using the database in a more reliable way - if numPublished >= numOnSource { - return nil - } minBalance := (float64(numOnSource)-float64(numPublished))*(publishAmount+0.1) + channelClaimAmount - if numPublished > numOnSource { + if numPublished > numOnSource && balance.LessThan(decimal.NewFromFloat(1)) { SendErrorToSlack("something is going on as we published more videos than those available on source: %d/%d", numPublished, numOnSource) minBalance = 1 //since we ended up in this function it means some juice is still needed }