diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-11-03 15:28:45 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | e552233512e0ccb1e296144d5446e2bb5b31212c (patch) | |
tree | 73eee066df01e0f2cfe406174d7620147873b7d1 /dex | |
parent | 5454042ddf8b3a0b95292fa04479b919d845896b (diff) | |
download | dexon-e552233512e0ccb1e296144d5446e2bb5b31212c.tar.gz dexon-e552233512e0ccb1e296144d5446e2bb5b31212c.tar.zst dexon-e552233512e0ccb1e296144d5446e2bb5b31212c.zip |
test: start a separate RPC node for testing block sync
Diffstat (limited to 'dex')
-rw-r--r-- | dex/backend.go | 11 | ||||
-rw-r--r-- | dex/handler.go | 4 |
2 files changed, 5 insertions, 10 deletions
diff --git a/dex/backend.go b/dex/backend.go index 3a50eb649..74aea8325 100644 --- a/dex/backend.go +++ b/dex/backend.go @@ -249,12 +249,6 @@ func (s *Dexon) Start(srvr *p2p.Server) error { // Start the networking layer and the light server if requested s.protocolManager.Start(srvr, maxPeers) s.protocolManager.addSelfMeta() - - go func() { - time.Sleep(10 * time.Second) - // TODO: Run with the latest confirmed block in compaction chain. - s.consensus.Run(&coreTypes.Block{}) - }() return nil } @@ -263,9 +257,8 @@ func (s *Dexon) Stop() error { } func (s *Dexon) StartProposing() error { - // TODO(sonic): - // enable dispatch vote, agreement result, finalization result.. msg to consensus core. - log.Debug("###############start proposing") + // TODO: Run with the latest confirmed block in compaction chain. + s.consensus.Run(&coreTypes.Block{}) return nil } diff --git a/dex/handler.go b/dex/handler.go index 68c682eda..00d2fb78c 100644 --- a/dex/handler.go +++ b/dex/handler.go @@ -1046,7 +1046,9 @@ func (pm *ProtocolManager) peerSetLoop() { for { select { - case <-pm.chainHeadCh: + case event := <-pm.chainHeadCh: + pm.BroadcastBlock(event.Block, true) + newRound := pm.gov.LenCRS() - 1 log.Trace("new round", "round", newRound) if newRound == round { |