Skip to content

Commit

Permalink
go/worker/common: Treat unknown P2P message type as a permanent error
Browse files Browse the repository at this point in the history
  • Loading branch information
kostko committed Jun 25, 2020
1 parent b9cfe02 commit be3b60a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion go/worker/common/committee/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
runtimeRegistry "github.com/oasisprotocol/oasis-core/go/runtime/registry"
storage "github.com/oasisprotocol/oasis-core/go/storage/api"
"github.com/oasisprotocol/oasis-core/go/worker/common/p2p"
p2pError "github.com/oasisprotocol/oasis-core/go/worker/common/p2p/error"
)

var (
Expand Down Expand Up @@ -167,7 +168,7 @@ func (n *Node) HandlePeerMessage(ctx context.Context, message *p2p.Message) erro
return nil
}
}
return errors.New("unknown message type")
return p2pError.Permanent(errors.New("unknown message type"))
}

// Guarded by n.CrossNode.
Expand Down

0 comments on commit be3b60a

Please sign in to comment.