// WaitForRound waits for all the nodes in the network to
// reach the specified block.
WaitForRound waits for all the nodes in the network to
reach the specified block.
// WaitForRound waits for all the nodes in the network to // reach the specified block .
func (n *TestNetwork) WaitForBlock(block uint64) error {
	if len(n.nodes) == 0 {
		return nil
	}
	results := make(chan error)
	for _, node := range n.nodes {
		go func() {
			if ri := <-node.WaitForBlock(block); ri != block {
				results <- fmt.Errorf("for %x block expected to be %d but got %d", node.PublicKey(), block, ri)
			} else {
				results <- nil
			}
		}()
	}
	for range n.nodes {
		if err := <-results; err != nil {
			return err
		}
	}
	return nil
}
func ( n * TestNetwork ) WaitForBlock ( block uint64 ) error { if len ( n . nodes ) == 0 { return nil } results := make ( chan error ) for _ , node := range n . nodes { go func ( ) { if ri := <- node . WaitForBlock ( block ) ; ri != block { results <- fmt . Errorf ( " " , node . PublicKey ( ) , block , ri ) } else { results <- nil } } ( ) } for range n . nodes { if err := <- results ; err != nil { return err } } return nil }
WaitForRound waits for all the nodes in the network to
reach the specified block.
WaitForRound waits for all the nodes in the network to reach the specified block .