truechain / truechain-consensus-core

TrueChain Consensus Protocol: Minerva
Apache License 2.0
161 stars 70 forks source link

add a wait threshold timer instead of timer.sleep(1) #43

Open arcolife opened 6 years ago

arcolife commented 6 years ago

TODO comments in src/pbft-core/pbft-sim-engine/pbftserverengine.go


    // TODO: change listenready to switch case assertion and kill-timer clock
    for i := 0; i < cfg.N; i++ {
        <-svList[i].Nd.ListenReady
    }

    time.Sleep(1 * time.Second) // wait for the servers to accept incoming connections
    for i := 0; i < cfg.N; i++ {
        svList[i].Nd.SetupReady <- true // make them to dial each other's RPCs
    }

    // TODO: change listenready to switch case assertion and kill-timer clock
    //fmt.Println("[!!!] Please allow the program to accept incoming connections if you are using Mac OS.")
    time.Sleep(1 * time.Second) // wait for the servers to accept incoming connections