revert change peer address change (#101)

This commit is contained in:
Liam 2022-06-21 00:11:06 +02:00 committed by GitHub
parent bcffe1ec16
commit 35b964fc16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -856,9 +856,6 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
if err := msg.Decode(&vote); err != nil {
return errResp(ErrDecode, "msg %v: %v", msg, err)
}
// 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())
exist, _ := pm.knownVotes.ContainsOrAdd(vote.Hash(), true)
@ -878,10 +875,6 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
if err := msg.Decode(&timeout); err != nil {
return errResp(ErrDecode, "msg %v: %v", msg, err)
}
// 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())
exist, _ := pm.knownTimeouts.ContainsOrAdd(timeout.Hash(), true)
@ -902,9 +895,6 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
if err := msg.Decode(&syncInfo); err != nil {
return errResp(ErrDecode, "msg %v: %v", msg, err)
}
// 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())
exist, _ := pm.knownSyncInfos.ContainsOrAdd(syncInfo.Hash(), true)