Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
Todd Stock committed Feb 12, 2021
1 parent 4d5ade8 commit 7d48c70
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions stream/producer_cchain.go
Expand Up @@ -43,7 +43,6 @@ const (
dbReadTimeout = 10 * time.Second
dbWriteTimeout = 10 * time.Second

notFoundSleep = 1 * time.Second
readRPCTimeout = 500 * time.Millisecond

blocksToQueue = 25
Expand Down Expand Up @@ -249,12 +248,12 @@ func (p *ProducerCChain) ProcessNextMessage() error {
}

lblocknext := big.NewInt(0).SetUint64(lblock)
if lblocknext.Cmp(current) >= 0 {
if lblocknext.Cmp(p.block) <= 0 {
time.Sleep(readRPCTimeout)
continue
}

for lblocknext.Cmp(current) < 0 {
for lblocknext.Cmp(p.block) > 0 {
bl, err := p.readBlockFromRPC(current)
if err != nil {
time.Sleep(readRPCTimeout)
Expand Down

0 comments on commit 7d48c70

Please sign in to comment.