mirror of https://github.com/poanetwork/quorum.git
refined NewBlockMsg handling in Istanbul
This commit is contained in:
parent
30f506208c
commit
784491e502
|
@ -94,7 +94,7 @@ func (sb *backend) HandleMsg(addr common.Address, msg p2p.Msg) (bool, error) {
|
||||||
if msg.Code == 0x07 && sb.core.IsProposer() { // eth.NewBlockMsg: import cycle
|
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
|
// this case is to safeguard the race of similar block which gets propagated from other node while this node is proposing
|
||||||
|
|
||||||
if _, hash, err := sb.decode(msg); err == nil {
|
if data, hash, err := sb.decode(msg); err == nil && len(data) > 0 {
|
||||||
if _, ok := sb.knownMessages.Get(hash); ok {
|
if _, ok := sb.knownMessages.Get(hash); ok {
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue