Skip to content

Commit

Permalink
Merge pull request #27 from oasysgames/dev-v1.0.6
Browse files Browse the repository at this point in the history
p2p: define DiscReason as uint8
  • Loading branch information
ironbeer authored Apr 4, 2023
2 parents 23ff1b0 + c3f6a4e commit 9361854
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions p2p/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,11 @@ func (p *Peer) handle(msg Msg) error {
msg.Discard()
go SendItems(p.rw, pongMsg)
case msg.Code == discMsg:
var reason [1]DiscReason
// This is the last message. We don't need to discard or
// check errors because, the connection will be closed after it.
rlp.Decode(msg.Payload, &reason)
return reason[0]
var m struct{ R DiscReason }
rlp.Decode(msg.Payload, &m)
return m.R
case msg.Code < baseProtocolLength:
// ignore other base protocol messages
return msg.Discard()
Expand Down
2 changes: 1 addition & 1 deletion p2p/peer_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (pe *peerError) Error() string {

var errProtocolReturned = errors.New("protocol returned")

type DiscReason uint
type DiscReason uint8

const (
DiscRequested DiscReason = iota
Expand Down
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
const (
VersionMajor = 1 // Major version component of the current release
VersionMinor = 0 // Minor version component of the current release
VersionPatch = 5 // Patch version component of the current release
VersionPatch = 6 // Patch version component of the current release
VersionMeta = "" // Version metadata to append to the version string
)

Expand Down

0 comments on commit 9361854

Please sign in to comment.