only process messages for istanbul

This commit is contained in:
Trung Nguyen 2018-10-11 14:02:32 -04:00
parent f0f472404f
commit 30f506208c
No known key found for this signature in database
GPG Key ID: 4636434ED9505EB7
1 changed files with 4 additions and 6 deletions

View File

@ -94,12 +94,10 @@ func (sb *backend) HandleMsg(addr common.Address, msg p2p.Msg) (bool, error) {
if msg.Code == 0x07 && sb.core.IsProposer() { // eth.NewBlockMsg: import cycle
// this case is to safeguard the race of similar block which gets propagated from other node while this node is proposing
_, hash, err := sb.decode(msg)
if err != nil {
return true, errDecodeFailed
}
if _, ok := sb.knownMessages.Get(hash); ok {
return true, nil
if _, hash, err := sb.decode(msg); err == nil {
if _, ok := sb.knownMessages.Get(hash); ok {
return true, nil
}
}
}
return false, nil