OSDN Git Service

Fix consensus msg sync bugs consensus_sync
authorYahtoo Ma <yahtoo.ma@gmail.com>
Mon, 10 Jun 2019 08:56:45 +0000 (16:56 +0800)
committerYahtoo Ma <yahtoo.ma@gmail.com>
Mon, 10 Jun 2019 08:56:45 +0000 (16:56 +0800)
fix peer status update error
fix block signature mark error

netsync/consensusmgr/handle.go

index 66fddd9..bf21b6f 100644 (file)
@@ -91,6 +91,7 @@ func (m *Manager) handleBlockProposeMsg(peerID string, msg *BlockProposeMsg) {
        hash := block.Hash()
        m.peers.MarkBlock(peerID, &hash)
        m.blockFetcher.processNewBlock(&blockMsg{peerID: peerID, block: block})
+       m.peers.SetStatus(peerID, block.Height, &hash)
 }
 
 func (m *Manager) handleBlockSignatureMsg(peerID string, msg *BlockSignatureMsg) {
@@ -99,6 +100,7 @@ func (m *Manager) handleBlockSignatureMsg(peerID string, msg *BlockSignatureMsg)
                m.peers.ProcessIllegal(peerID, security.LevelMsgIllegal, err.Error())
                return
        }
+       m.peers.MarkBlockSignature(peerID, msg.Signature)
 }
 
 func (m *Manager) blockProposeMsgBroadcastLoop() {