diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-10-15 11:17:59 +0800 |
---|---|---|
committer | Wei-Ning Huang <aitjcize@gmail.com> | 2018-10-15 11:17:59 +0800 |
commit | 52d490fa7e6b108f71ffb8937554141d5c668ff1 (patch) | |
tree | 832567efb84766fafe67c2f83dd24e6c20e8a746 /simulation/node.go | |
parent | c59b65f22bcd61b10c654ee784d6b8bef9fd3bca (diff) | |
download | tangerine-consensus-52d490fa7e6b108f71ffb8937554141d5c668ff1.tar.gz tangerine-consensus-52d490fa7e6b108f71ffb8937554141d5c668ff1.tar.zst tangerine-consensus-52d490fa7e6b108f71ffb8937554141d5c668ff1.zip |
core: fix simulation error (#201)
* Sync dMoment for all consensus core
* App check for randomness ignore round 0
Diffstat (limited to 'simulation/node.go')
-rw-r--r-- | simulation/node.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/simulation/node.go b/simulation/node.go index a6d5b89..b908d73 100644 --- a/simulation/node.go +++ b/simulation/node.go @@ -20,6 +20,7 @@ package simulation import ( "fmt" "sort" + "time" "github.com/dexon-foundation/dexon-consensus-core/common" "github.com/dexon-foundation/dexon-consensus-core/core" @@ -75,7 +76,7 @@ func (n *node) GetID() types.NodeID { } // run starts the node. -func (n *node) run(serverEndpoint interface{}) { +func (n *node) run(serverEndpoint interface{}, dMoment time.Time) { // Run network. if err := n.netModule.setup(serverEndpoint); err != nil { panic(err) @@ -98,7 +99,8 @@ func (n *node) run(serverEndpoint interface{}) { break } } - n.consensus = core.NewConsensus(n.app, n.gov, n.db, n.netModule, n.prvKey) + n.consensus = core.NewConsensus( + dMoment, n.app, n.gov, n.db, n.netModule, n.prvKey) go n.consensus.Run() // Blocks forever. |