diff options
author | Felix Lange <fjl@twurst.com> | 2015-02-07 07:13:22 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-02-07 07:43:52 +0800 |
commit | e34d1341022a51d8a86c4836c91e4e0ded888d27 (patch) | |
tree | 35dacd9390e6181803329f8c5c7d1cb076ba0128 /p2p/message.go | |
parent | 8564eb9f7efcc7a0e639f6a45d7e67037fedac5f (diff) | |
download | go-tangerine-e34d1341022a51d8a86c4836c91e4e0ded888d27.tar go-tangerine-e34d1341022a51d8a86c4836c91e4e0ded888d27.tar.gz go-tangerine-e34d1341022a51d8a86c4836c91e4e0ded888d27.tar.bz2 go-tangerine-e34d1341022a51d8a86c4836c91e4e0ded888d27.tar.lz go-tangerine-e34d1341022a51d8a86c4836c91e4e0ded888d27.tar.xz go-tangerine-e34d1341022a51d8a86c4836c91e4e0ded888d27.tar.zst go-tangerine-e34d1341022a51d8a86c4836c91e4e0ded888d27.zip |
p2p: fixes for actual connections
The unit test hooks were turned on 'in production'.
Diffstat (limited to 'p2p/message.go')
-rw-r--r-- | p2p/message.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/p2p/message.go b/p2p/message.go index 6521d09c2..dfc33f349 100644 --- a/p2p/message.go +++ b/p2p/message.go @@ -174,10 +174,10 @@ func (rw *frameRW) ReadMsg() (msg Msg, err error) { // read magic and payload size start := make([]byte, 8) if _, err = io.ReadFull(rw.bufconn, start); err != nil { - return msg, newPeerError(errRead, "%v", err) + return msg, err } if !bytes.HasPrefix(start, magicToken) { - return msg, newPeerError(errMagicTokenMismatch, "got %x, want %x", start[:4], magicToken) + return msg, fmt.Errorf("bad magic token %x", start[:4], magicToken) } size := binary.BigEndian.Uint32(start[4:]) |