mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-16 09:50:45 +00:00
xin-144 avoid duplicate messages (#68)
* avoid duplicate messages * update comment
This commit is contained in:
parent
8363641b2c
commit
7fca1a627a
1 changed files with 6 additions and 0 deletions
|
|
@ -831,6 +831,8 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
|
||||||
return errResp(ErrDecode, "msg %v: %v", msg, err)
|
return errResp(ErrDecode, "msg %v: %v", msg, err)
|
||||||
}
|
}
|
||||||
// Mark the peer as owning the vote and process it
|
// Mark the peer as owning the vote and process it
|
||||||
|
// because peer has 2 address sender and receive, so use p.id to find the right address
|
||||||
|
p = pm.peers.Peer(p.id)
|
||||||
p.MarkVote(vote.Hash())
|
p.MarkVote(vote.Hash())
|
||||||
pm.bft.Vote(&vote)
|
pm.bft.Vote(&vote)
|
||||||
case msg.Code == TimeoutMsg:
|
case msg.Code == TimeoutMsg:
|
||||||
|
|
@ -840,6 +842,8 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mark the peer as owning the timeout and process it
|
// Mark the peer as owning the timeout and process it
|
||||||
|
// because peer has 2 address sender and receive, so use p.id to find the right address
|
||||||
|
p = pm.peers.Peer(p.id)
|
||||||
p.MarkTimeout(timeout.Hash())
|
p.MarkTimeout(timeout.Hash())
|
||||||
pm.bft.Timeout(&timeout)
|
pm.bft.Timeout(&timeout)
|
||||||
case msg.Code == SyncInfoMsg:
|
case msg.Code == SyncInfoMsg:
|
||||||
|
|
@ -848,6 +852,8 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
|
||||||
return errResp(ErrDecode, "msg %v: %v", msg, err)
|
return errResp(ErrDecode, "msg %v: %v", msg, err)
|
||||||
}
|
}
|
||||||
// Mark the peer as owning the syncInfo and process it
|
// Mark the peer as owning the syncInfo and process it
|
||||||
|
// because peer has 2 address sender and receive, so use p.id to find the right address
|
||||||
|
p = pm.peers.Peer(p.id)
|
||||||
p.MarkSyncInfo(syncInfo.Hash())
|
p.MarkSyncInfo(syncInfo.Hash())
|
||||||
pm.bft.SyncInfo(&syncInfo)
|
pm.bft.SyncInfo(&syncInfo)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue