From 1729af0ae524516cb320864543601612fc58176f Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Wed, 12 Jun 2019 05:25:01 +0200 Subject: [PATCH] fix UTXOs management while publishing fix account_set improve logging --- go.mod | 2 +- go.sum | 4 ++-- manager/ytsync.go | 20 +++++++------------- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index c367136..4df21c2 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect github.com/kr/pretty v0.1.0 // indirect github.com/lbryio/errors.go v0.0.0-20180223142025-ad03d3cc6a5c - github.com/lbryio/lbry.go v1.0.12 + github.com/lbryio/lbry.go v1.0.13 github.com/lusis/slack-test v0.0.0-20190408224659-6cf59653add2 // indirect github.com/mitchellh/go-ps v0.0.0-20170309133038-4fdf99ab2936 github.com/mitchellh/mapstructure v1.1.2 // indirect diff --git a/go.sum b/go.sum index fbe62bf..e7c853d 100644 --- a/go.sum +++ b/go.sum @@ -129,8 +129,8 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lbryio/errors.go v0.0.0-20180223142025-ad03d3cc6a5c h1:BhdcWGsuKif/XoSZnqVGNqJ1iEmH0czWR5upj+AuR8M= github.com/lbryio/errors.go v0.0.0-20180223142025-ad03d3cc6a5c/go.mod h1:muH7wpUqE8hRA3OrYYosw9+Sl681BF9cwcjzE+OCNK8= -github.com/lbryio/lbry.go v1.0.12 h1:hS0d3uBdohz3zvr5tCWpxiMkjkV3Kkq1Q+0HrfJBXlQ= -github.com/lbryio/lbry.go v1.0.12/go.mod h1:JtyI30bU51rm0LZ/po3mQuzf++14OWb6kR/6mMRAmKU= +github.com/lbryio/lbry.go v1.0.13 h1:IwQwI/quBds3DW/nnnbM7llCDrw9YShBSpSD39eR3Z8= +github.com/lbryio/lbry.go v1.0.13/go.mod h1:JtyI30bU51rm0LZ/po3mQuzf++14OWb6kR/6mMRAmKU= github.com/lbryio/lbryschema.go v0.0.0-20190428231007-c54836bca002 h1:urfYK5ElpUrAv90auPLldoVC60LwiGAcY0OE6HJB9KI= github.com/lbryio/lbryschema.go v0.0.0-20190428231007-c54836bca002/go.mod h1:dAzPCBj3CKKWBGYBZxK6tKBP5SCgY2tqd9SnQd/OyKo= github.com/lbryio/ozzo-validation v0.0.0-20170323141101-d1008ad1fd04 h1:Nze+C2HbeKvhjI/kVn+9Poj/UuEW5sOQxcsxqO7L3GI= diff --git a/manager/ytsync.go b/manager/ytsync.go index 8b21a7c..143c98f 100644 --- a/manager/ytsync.go +++ b/manager/ytsync.go @@ -645,7 +645,7 @@ func (s *Sync) startWorker(workerNum int) { err := s.processVideo(v) if err != nil { - logMsg := "error processing video: " + err.Error() + logMsg := fmt.Sprintf("error processing video %s: %s", v.ID(), err.Error()) log.Errorln(logMsg) fatalErrors := []string{ ":5279: read: connection reset by peer", @@ -679,20 +679,14 @@ func (s *Sync) startWorker(workerNum int) { if util.SubstringInSlice(err.Error(), errorsNoRetry) { log.Println("This error should not be retried at all") } else if tryCount < s.MaxTries { - if strings.Contains(err.Error(), "txn-mempool-conflict") || - strings.Contains(err.Error(), "too-long-mempool-chain") { - log.Println("waiting for a block before retrying") - err = s.waitForNewBlock() - if err != nil { - s.grp.Stop() - SendErrorToSlack("something went wrong while waiting for a block: %v", err) - break - } - } else if util.SubstringInSlice(err.Error(), []string{ + if util.SubstringInSlice(err.Error(), []string{ "Not enough funds to cover this transaction", "failed: Not enough funds", - "Error in daemon: Insufficient funds, please deposit additional LBC"}) { - log.Println("refilling addresses before retrying") + "Error in daemon: Insufficient funds, please deposit additional LBC", + "txn-mempool-conflict", + "too-long-mempool-chain", + }) { + log.Println("checking funds and UTXOs before retrying...") err = s.walletSetup() if err != nil { s.grp.Stop()