Skip to content

Commit ec5153f

Browse files
authored
Merge pull request #1229 from jbhurat/ibft_check_core
istanbul: Check if sb.core is nil before processing NewBlockMsg
2 parents b77e8c3 + b8217cd commit ec5153f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

consensus/istanbul/backend/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func (sb *Backend) HandleMsg(addr common.Address, msg p2p.Msg) (bool, error) {
103103
}
104104
//https://github.com/ConsenSys/quorum/pull/539
105105
//https://github.com/ConsenSys/quorum/issues/389
106-
if msg.Code == NewBlockMsg && sb.core.IsProposer() { // eth.NewBlockMsg: import cycle
106+
if msg.Code == NewBlockMsg && sb.core != nil && sb.core.IsProposer() { // eth.NewBlockMsg: import cycle
107107
// this case is to safeguard the race of similar block which gets propagated from other node while this node is proposing
108108
// as p2p.Msg can only be decoded once (get EOF for any subsequence read), we need to make sure the payload is restored after we decode it
109109
sb.logger.Debug("BFT: received NewBlockMsg", "size", msg.Size, "payload.type", reflect.TypeOf(msg.Payload), "sender", addr)

0 commit comments

Comments
 (0)