remove confusing logic

pull/1134/head
Minh Doan 5 years ago committed by Minh Doan
parent 084ce83224
commit bbed4a4db7
  1. 6
      node/node_newblock.go

@ -55,12 +55,7 @@ func (node *Node) WaitForConsensusReadyv2(readySignal chan struct{}, stopChan ch
} }
} }
case <-readySignal: case <-readySignal:
firstTry := true
for { for {
if !firstTry {
time.Sleep(PeriodicBlock)
}
firstTry = false
// threshold and firstTime are for the test-only built-in smart contract tx. // threshold and firstTime are for the test-only built-in smart contract tx.
// TODO: remove in production // TODO: remove in production
threshold := DefaultThreshold threshold := DefaultThreshold
@ -69,6 +64,7 @@ func (node *Node) WaitForConsensusReadyv2(readySignal chan struct{}, stopChan ch
firstTime = false firstTime = false
} }
if len(node.pendingTransactions) < threshold && time.Now().Before(deadline) { if len(node.pendingTransactions) < threshold && time.Now().Before(deadline) {
time.Sleep(PeriodicBlock)
continue continue
} }
// Normal tx block consensus // Normal tx block consensus

Loading…
Cancel
Save