aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/peer_error.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2014-11-04 20:21:44 +0800
committerFelix Lange <fjl@twurst.com>2014-11-22 04:52:45 +0800
commitf38052c499c1fee61423efeddb1f52677f1442e9 (patch)
tree6cc4c4e9739d61edeba9dc62781b2ebdeb0faf11 /p2p/peer_error.go
parent8cf9ed0ea588e97f2baf0f834248727e8fbca18f (diff)
downloaddexon-f38052c499c1fee61423efeddb1f52677f1442e9.tar
dexon-f38052c499c1fee61423efeddb1f52677f1442e9.tar.gz
dexon-f38052c499c1fee61423efeddb1f52677f1442e9.tar.bz2
dexon-f38052c499c1fee61423efeddb1f52677f1442e9.tar.lz
dexon-f38052c499c1fee61423efeddb1f52677f1442e9.tar.xz
dexon-f38052c499c1fee61423efeddb1f52677f1442e9.tar.zst
dexon-f38052c499c1fee61423efeddb1f52677f1442e9.zip
p2p: rework protocol API
Diffstat (limited to 'p2p/peer_error.go')
-rw-r--r--p2p/peer_error.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/p2p/peer_error.go b/p2p/peer_error.go
index de921878a..f3ef98d98 100644
--- a/p2p/peer_error.go
+++ b/p2p/peer_error.go
@@ -9,10 +9,9 @@ type ErrorCode int
const errorChanCapacity = 10
const (
- PacketTooShort = iota
+ PacketTooLong = iota
PayloadTooShort
MagicTokenMismatch
- EmptyPayload
ReadError
WriteError
MiscError
@@ -31,10 +30,9 @@ const (
)
var errorToString = map[ErrorCode]string{
- PacketTooShort: "Packet too short",
+ PacketTooLong: "Packet too long",
PayloadTooShort: "Payload too short",
MagicTokenMismatch: "Magic token mismatch",
- EmptyPayload: "Empty payload",
ReadError: "Read error",
WriteError: "Write error",
MiscError: "Misc error",
@@ -71,6 +69,6 @@ func (self *PeerError) Error() string {
return self.message
}
-func NewPeerErrorChannel() chan *PeerError {
- return make(chan *PeerError, errorChanCapacity)
+func NewPeerErrorChannel() chan error {
+ return make(chan error, errorChanCapacity)
}