diff options
author | Sonic <sonic@dexon.org> | 2018-12-21 14:53:37 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | f5522f0ffcbe127a8fd364647848be46ecc68cda (patch) | |
tree | fb31ed0a49864ff6876f2130acd5e33c245fad1a /dex/handler.go | |
parent | 4002c85e8e073f3a03dbd8c71e98188c0306a942 (diff) | |
download | dexon-f5522f0ffcbe127a8fd364647848be46ecc68cda.tar.gz dexon-f5522f0ffcbe127a8fd364647848be46ecc68cda.tar.zst dexon-f5522f0ffcbe127a8fd364647848be46ecc68cda.zip |
core, dex, internal: block proposer syncing (first iteration) (#96)
* dex, internal: block proposer syncing (first iteration)
* core: find block from db if not in memory
This fix handles stopping proposing and then restarting
* core: no need to reorg when reset
Dexon will not fork. This commit also fix when a block confirm but
its parent is not in db yet, during restarting proposing.
* dex: always accept NewBlockMsg, NewBlockHashesMsg
We need to accept NewBlockMsg, NewBlockHashesMsg to sync current block with
other peers in block proposer mode when syncing lattice data. It's a waste
when the node is synced and start proposing.
Todo: control msg processing on/off more granular, accept NewBlockMsg,
NewBlockHashesMsg when syncing, but stop when synced.
Diffstat (limited to 'dex/handler.go')
-rw-r--r-- | dex/handler.go | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/dex/handler.go b/dex/handler.go index 9174d8516..ff87884d2 100644 --- a/dex/handler.go +++ b/dex/handler.go @@ -713,10 +713,6 @@ func (pm *ProtocolManager) handleMsg(p *peer) error { } case msg.Code == NewBlockHashesMsg: - // Ignore new block hash messages in block proposer mode. - if pm.isBlockProposer { - break - } var announces newBlockHashesData if err := msg.Decode(&announces); err != nil { return errResp(ErrDecode, "%v: %v", msg, err) @@ -737,10 +733,6 @@ func (pm *ProtocolManager) handleMsg(p *peer) error { } case msg.Code == NewBlockMsg: - // Ignore new block messages in block proposer mode. - if pm.isBlockProposer { - break - } // Retrieve and decode the propagated block var block types.Block if err := msg.Decode(&block); err != nil { |