mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
whisper: gofmt to quell linter
This commit is contained in:
parent
82bc100542
commit
ae8c0743cc
1 changed files with 11 additions and 11 deletions
|
|
@ -17,12 +17,12 @@
|
||||||
package whisperv6
|
package whisperv6
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"fmt"
|
||||||
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"time"
|
"time"
|
||||||
"bufio"
|
|
||||||
"github.com/ethereum/go-ethereum/rlp"
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/p2p"
|
"github.com/ethereum/go-ethereum/p2p"
|
||||||
inet "github.com/libp2p/go-libp2p-net"
|
inet "github.com/libp2p/go-libp2p-net"
|
||||||
|
|
@ -36,9 +36,9 @@ type LibP2PStream struct {
|
||||||
|
|
||||||
// serializableP2PMsg is the serializable version of p2p.Msg
|
// serializableP2PMsg is the serializable version of p2p.Msg
|
||||||
type serializableP2PMsg struct {
|
type serializableP2PMsg struct {
|
||||||
Code uint64
|
Code uint64
|
||||||
Size uint32
|
Size uint32
|
||||||
Payload []byte
|
Payload []byte
|
||||||
ReceivedAt time.Time
|
ReceivedAt time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -52,9 +52,9 @@ func (stream *LibP2PStream) ReadMsg() (p2p.Msg, error) {
|
||||||
}
|
}
|
||||||
err = rlp.DecodeBytes(raw, &m)
|
err = rlp.DecodeBytes(raw, &m)
|
||||||
msg := p2p.Msg{
|
msg := p2p.Msg{
|
||||||
Code: m.Code,
|
Code: m.Code,
|
||||||
Size: m.Size,
|
Size: m.Size,
|
||||||
Payload: bytes.NewReader(m.Payload),
|
Payload: bytes.NewReader(m.Payload),
|
||||||
ReceivedAt: m.ReceivedAt,
|
ReceivedAt: m.ReceivedAt,
|
||||||
}
|
}
|
||||||
return msg, err
|
return msg, err
|
||||||
|
|
@ -67,7 +67,7 @@ func (stream *LibP2PStream) WriteMsg(msg p2p.Msg) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error reading payload: %v", err)
|
return fmt.Errorf("Error reading payload: %v", err)
|
||||||
}
|
}
|
||||||
m := serializableP2PMsg {msg.Code, msg.Size, payload, msg.ReceivedAt}
|
m := serializableP2PMsg{msg.Code, msg.Size, payload, msg.ReceivedAt}
|
||||||
|
|
||||||
data, err := rlp.EncodeToBytes(m)
|
data, err := rlp.EncodeToBytes(m)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -84,4 +84,4 @@ func (stream *LibP2PStream) WriteMsg(msg p2p.Msg) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue