Merge pull request #202 from ngtuna/chainHeadCh

minor fix for chainHeadCh
This commit is contained in:
Tuna 2018-10-05 11:42:01 +07:00 committed by GitHub
commit 791769ce29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -482,9 +482,9 @@ func (self *worker) commitNewWork() {
L:
select {
case newBlock := <-self.chainHeadCh:
self.chainHeadCh <- newBlock
if newBlock.Block.NumberU64() > parent.NumberU64() {
log.Info("New block has came already. Skip this turn", "new block", newBlock.Block.NumberU64(), "current block", parent.NumberU64())
self.chainHeadCh <- newBlock
return
}
case <-time.After(time.Duration(gap) * time.Second):