From bbed4a4db753c64143c8a80c3660004d93624048 Mon Sep 17 00:00:00 2001 From: Minh Doan Date: Fri, 21 Jun 2019 16:38:21 -0700 Subject: [PATCH] remove confusing logic --- node/node_newblock.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/node/node_newblock.go b/node/node_newblock.go index f96b91986..1f00cc7d2 100644 --- a/node/node_newblock.go +++ b/node/node_newblock.go @@ -55,12 +55,7 @@ func (node *Node) WaitForConsensusReadyv2(readySignal chan struct{}, stopChan ch } } case <-readySignal: - firstTry := true for { - if !firstTry { - time.Sleep(PeriodicBlock) - } - firstTry = false // threshold and firstTime are for the test-only built-in smart contract tx. // TODO: remove in production threshold := DefaultThreshold @@ -69,6 +64,7 @@ func (node *Node) WaitForConsensusReadyv2(readySignal chan struct{}, stopChan ch firstTime = false } if len(node.pendingTransactions) < threshold && time.Now().Before(deadline) { + time.Sleep(PeriodicBlock) continue } // Normal tx block consensus