Merge pull request #654 from LeoHChen/wait_for_more_tx

[consensus] wait for more tx in one consensus
pull/669/head
Leo Chen 6 years ago committed by GitHub
commit 95c5fd2fd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cmd/client/txgen/main.go
  2. 3
      node/node_newblock.go

@ -158,7 +158,7 @@ func main() {
go func() {
// wait for 3 seconds for client to send ping message to leader
// FIXME (leo) the readySignal should be set once we really sent ping message to leader
time.Sleep(1 * time.Second) // wait for nodes to be ready
time.Sleep(3 * time.Second) // wait for nodes to be ready
for _, i := range shardIDs {
readySignal <- i
}

@ -12,6 +12,7 @@ const (
DefaultThreshold = 1
FirstTimeThreshold = 2
ConsensusTimeOut = 10
PeriodicBlock = 3 * time.Second
)
// WaitForConsensusReady listen for the readiness signal from consensus and generate new block for consensus.
@ -68,7 +69,7 @@ func (node *Node) WaitForConsensusReady(readySignal chan struct{}, stopChan chan
}
// If not enough transactions to run Consensus,
// periodically check whether we have enough transactions to package into block.
time.Sleep(1 * time.Second)
time.Sleep(PeriodicBlock)
}
// Send the new block to Consensus so it can be confirmed.
if newBlock != nil {

Loading…
Cancel
Save