diff options
author | Mission Liao <mission.liao@dexon.org> | 2019-03-23 23:41:04 +0800 |
---|---|---|
committer | Jimmy Hu <jimmy.hu@dexon.org> | 2019-03-23 23:41:04 +0800 |
commit | d077a35470cf4b6e7c82bd4b03a1f2b87b0f9add (patch) | |
tree | 8bf24cbb04def6851a474bdc941e19bd8ce9c2e7 /simulation/node.go | |
parent | fb9bbdf2a34aa45c0f032b996f72cafd7bccfa80 (diff) | |
download | tangerine-consensus-d077a35470cf4b6e7c82bd4b03a1f2b87b0f9add.tar tangerine-consensus-d077a35470cf4b6e7c82bd4b03a1f2b87b0f9add.tar.gz tangerine-consensus-d077a35470cf4b6e7c82bd4b03a1f2b87b0f9add.tar.bz2 tangerine-consensus-d077a35470cf4b6e7c82bd4b03a1f2b87b0f9add.tar.lz tangerine-consensus-d077a35470cf4b6e7c82bd4b03a1f2b87b0f9add.tar.xz tangerine-consensus-d077a35470cf4b6e7c82bd4b03a1f2b87b0f9add.tar.zst tangerine-consensus-d077a35470cf4b6e7c82bd4b03a1f2b87b0f9add.zip |
core: refine DKG aborting (#512)
* Avoid aborting the DKG protocol registered later
Although that DKG protocol would be registered after
1/2 round, both of them are triggered in separated
go routine and we shouldn't assuem their execution order.
* Capitalize logs
* Add test
* Return aborted when not running
* Log DKG aborting result
* Remove duplicated DKG abort
Diffstat (limited to 'simulation/node.go')
-rw-r--r-- | simulation/node.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/simulation/node.go b/simulation/node.go index b5b261c..5bd8ec1 100644 --- a/simulation/node.go +++ b/simulation/node.go @@ -149,12 +149,12 @@ readyLoop: break readyLoop case ntfSelectedAsMaster: n.logger.Info( - "receive 'selected-as-master' notification from server") + "Receive 'selected-as-master' notification from server") for _, c := range n.cfg.Node.Changes { if c.Round <= core.ConfigRoundShift+1 { continue } - n.logger.Info("register config change", "change", c) + n.logger.Info("Register config change", "change", c) if err := c.RegisterChange(n.gov); err != nil { panic(err) } @@ -181,11 +181,11 @@ MainLoop: switch val := msg.(type) { case serverNotification: if val == ntfShutdown { - n.logger.Info("receive shutdown notification from server") + n.logger.Info("Receive shutdown notification from server") break MainLoop } default: - panic(fmt.Errorf("unexpected message from server: %v", val)) + panic(fmt.Errorf("Unexpected message from server: %v", val)) } } // Cleanup. @@ -218,7 +218,7 @@ func (n *node) prepareConfigs() { // These rounds are not safe to be registered as pending state change // requests. for i := uint64(0); i <= core.ConfigRoundShift+1; i++ { - n.logger.Info("prepare config", "round", i) + n.logger.Info("Prepare config", "round", i) prepareConfigs(i, n.cfg.Node.Changes, n.gov) } // This notification is implictly called in full node. |