mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
whisper: run gofmt to quell linter
This commit is contained in:
parent
226eccdab0
commit
81f2b79428
3 changed files with 14 additions and 16 deletions
|
|
@ -201,12 +201,12 @@ func initialize() {
|
|||
|
||||
if *bootstrapMode {
|
||||
if !*useLibP2P {
|
||||
if len(*argIP) == 0 {
|
||||
argIP = scanLineA("Please enter your IP and port (e.g. 127.0.0.1:30348): ")
|
||||
}
|
||||
} else if *fileReader {
|
||||
*bootstrapMode = true
|
||||
} else {
|
||||
if len(*argIP) == 0 {
|
||||
argIP = scanLineA("Please enter your IP and port (e.g. 127.0.0.1:30348): ")
|
||||
}
|
||||
} else if *fileReader {
|
||||
*bootstrapMode = true
|
||||
} else {
|
||||
if *argPort == 0 {
|
||||
for {
|
||||
fmt.Print("Please enter the port to use: ")
|
||||
|
|
@ -759,7 +759,6 @@ func requestExpiredMessagesLoop() {
|
|||
fmt.Println("Error: topic is invalid, request aborted")
|
||||
continue
|
||||
}
|
||||
|
||||
if timeUpp == 0 {
|
||||
timeUpp = 0xFFFFFFFF
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,12 +17,12 @@
|
|||
package whisperv6
|
||||
|
||||
import (
|
||||
"io"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"io"
|
||||
"math"
|
||||
|
||||
"github.com/ethereum/go-ethereum/p2p"
|
||||
|
|
@ -30,11 +30,11 @@ import (
|
|||
host "github.com/libp2p/go-libp2p-host"
|
||||
inet "github.com/libp2p/go-libp2p-net"
|
||||
peer "github.com/libp2p/go-libp2p-peer"
|
||||
ma "github.com/multiformats/go-multiaddr"
|
||||
set "gopkg.in/fatih/set.v0"
|
||||
pstore "github.com/libp2p/go-libp2p-peerstore"
|
||||
swarm "github.com/libp2p/go-libp2p-swarm"
|
||||
"github.com/libp2p/go-libp2p/p2p/host/basic"
|
||||
ma "github.com/multiformats/go-multiaddr"
|
||||
set "gopkg.in/fatih/set.v0"
|
||||
)
|
||||
|
||||
// LibP2PStream is a wrapper used to implement the MsgReadWriter
|
||||
|
|
@ -183,7 +183,6 @@ func (server *LibP2PWhisperServer) connectToPeer(p *LibP2PPeer) error {
|
|||
p.connectionStream = &lps
|
||||
p.ws = p.connectionStream
|
||||
|
||||
|
||||
// TODO send my known list of peers
|
||||
|
||||
// Call HandlePeer to perform the handshake
|
||||
|
|
@ -194,7 +193,7 @@ func (server *LibP2PWhisperServer) connectToPeer(p *LibP2PPeer) error {
|
|||
|
||||
// Start starts the server
|
||||
func (server *LibP2PWhisperServer) Start() error {
|
||||
server.Host.SetStreamHandler(WhisperProtocolString, func (stream inet.Stream) {
|
||||
server.Host.SetStreamHandler(WhisperProtocolString, func(stream inet.Stream) {
|
||||
log.Info("opening stream from new peer")
|
||||
|
||||
pid := stream.Conn().RemotePeer()
|
||||
|
|
@ -303,4 +302,4 @@ func NewLibP2PWhisperServer(port uint, whisper *Whisper) (WhisperServer, error)
|
|||
|
||||
server := &LibP2PWhisperServer{h, []*LibP2PPeer{}, whisper}
|
||||
return server, nil
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@
|
|||
package whisperv6
|
||||
|
||||
import (
|
||||
"io"
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/binary"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"math/rand"
|
||||
|
|
@ -331,4 +331,4 @@ func TestEndOfStreamDoesNotBlockWriteMsg(t *testing.T) {
|
|||
if err == io.EOF {
|
||||
t.Fatalf("EOF got reported as an error")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue