diff --git a/cmd/wnode/main.go b/cmd/wnode/main.go index d831f0eb8d..0f6c8511fc 100644 --- a/cmd/wnode/main.go +++ b/cmd/wnode/main.go @@ -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 } diff --git a/whisper/whisperv6/libp2p_glue.go b/whisper/whisperv6/libp2p_glue.go index e3626efc8d..82d095dad2 100644 --- a/whisper/whisperv6/libp2p_glue.go +++ b/whisper/whisperv6/libp2p_glue.go @@ -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 -} \ No newline at end of file +} diff --git a/whisper/whisperv6/libp2p_glue_test.go b/whisper/whisperv6/libp2p_glue_test.go index 7e79b67d5b..fcfb6737e9 100644 --- a/whisper/whisperv6/libp2p_glue_test.go +++ b/whisper/whisperv6/libp2p_glue_test.go @@ -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") } -} \ No newline at end of file +}