various bug fixes

This commit is contained in:
Niko Storni 2018-08-09 20:04:39 -04:00
parent ea7e2707d0
commit 88095bf8ad
2 changed files with 15 additions and 4 deletions

View file

@ -159,6 +159,10 @@ func (s SyncManager) MarkVideoStatus(channelID string, videoID string, status st
vals.Add("claim_name", claimName)
}
if failureReason != "" {
maxReasonLength := 500
if len(failureReason) > maxReasonLength {
failureReason = failureReason[:500]
}
vals.Add("failure_reason", failureReason)
}
res, _ := http.PostForm(endpoint, vals)

View file

@ -445,14 +445,21 @@ func (s *Sync) startWorker(workerNum int) {
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(), "failed: Not enough funds") ||
strings.Contains(err.Error(), "Error in daemon: Insufficient funds, please deposit additional LBC") ||
strings.Contains(err.Error(), "too-long-mempool-chain") {
log.Println("waiting for a block and refilling addresses before retrying")
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 strings.Contains(err.Error(), "failed: Not enough funds") ||
strings.Contains(err.Error(), "Error in daemon: Insufficient funds, please deposit additional LBC") {
log.Println("refilling addresses before retrying")
err = s.walletSetup()
if err != nil {
s.grp.Stop()
SendErrorToSlack("Failed to setup the wallet for a refill: %v", err)
SendErrorToSlack("failed to setup the wallet for a refill: %v", err)
break
}
}