mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-23 07:04:35 +00:00
xin-201 skip message while synchronize (#100)
This commit is contained in:
parent
ac5096d692
commit
2d25b89610
1 changed files with 15 additions and 0 deletions
|
|
@ -847,6 +847,11 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
|
|||
pm.lendingpool.AddRemotes(txs)
|
||||
}
|
||||
case msg.Code == VoteMsg:
|
||||
// VoteMsg arrived, make sure we have a valid and fresh chain to handle them
|
||||
if atomic.LoadUint32(&pm.acceptTxs) == 0 {
|
||||
break
|
||||
}
|
||||
|
||||
var vote types.Vote
|
||||
if err := msg.Decode(&vote); err != nil {
|
||||
return errResp(ErrDecode, "msg %v: %v", msg, err)
|
||||
|
|
@ -864,6 +869,11 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
|
|||
}
|
||||
|
||||
case msg.Code == TimeoutMsg:
|
||||
// TimeoutMsg arrived, make sure we have a valid and fresh chain to handle them
|
||||
if atomic.LoadUint32(&pm.acceptTxs) == 0 {
|
||||
break
|
||||
}
|
||||
|
||||
var timeout types.Timeout
|
||||
if err := msg.Decode(&timeout); err != nil {
|
||||
return errResp(ErrDecode, "msg %v: %v", msg, err)
|
||||
|
|
@ -883,6 +893,11 @@ func (pm *ProtocolManager) handleMsg(p *peer) error {
|
|||
}
|
||||
|
||||
case msg.Code == SyncInfoMsg:
|
||||
// SyncInfoMsg arrived, make sure we have a valid and fresh chain to handle them
|
||||
if atomic.LoadUint32(&pm.acceptTxs) == 0 {
|
||||
break
|
||||
}
|
||||
|
||||
var syncInfo types.SyncInfo
|
||||
if err := msg.Decode(&syncInfo); err != nil {
|
||||
return errResp(ErrDecode, "msg %v: %v", msg, err)
|
||||
|
|
|
|||
Loading…
Reference in a new issue