only wait a maximum of 2 blocks before transfering

fix debug string
This commit is contained in:
Niko Storni 2020-05-08 16:33:29 +02:00
parent 963c450730
commit 76301d40ba
2 changed files with 4 additions and 2 deletions

View file

@ -22,8 +22,9 @@ func waitConfirmations(s *Sync) error {
return err return err
} }
allConfirmed := false allConfirmed := false
waitCount := 0
waiting: waiting:
for !allConfirmed { for !allConfirmed || waitCount >= 2 {
utxolist, err := s.daemon.UTXOList(&defaultAccount, 1, 10000) utxolist, err := s.daemon.UTXOList(&defaultAccount, 1, 10000)
if err != nil { if err != nil {
return err return err
@ -37,6 +38,7 @@ waiting:
if err != nil { if err != nil {
return err return err
} }
waitCount++
continue waiting continue waiting
} }
} }

View file

@ -146,7 +146,7 @@ func (a *APIConfig) SetChannelCert(certHex string, channelID string) error {
body, _ := ioutil.ReadAll(res.Body) body, _ := ioutil.ReadAll(res.Body)
if res.StatusCode != http.StatusOK { if res.StatusCode != http.StatusOK {
util.SendErrorToSlack("Error %d while trying to call %s. Waiting to retry", res.StatusCode, endpoint) util.SendErrorToSlack("Error %d while trying to call %s. Waiting to retry", res.StatusCode, endpoint)
log.Debugln(body) log.Debugln(string(body))
time.Sleep(30 * time.Second) time.Sleep(30 * time.Second)
return a.SetChannelCert(certHex, channelID) return a.SetChannelCert(certHex, channelID)
} }