OSDN Git Service

Optimized code format
authorYahtoo Ma <yahtoo.ma@gmail.com>
Tue, 17 Apr 2018 05:27:38 +0000 (13:27 +0800)
committerYahtoo Ma <yahtoo.ma@gmail.com>
Tue, 17 Apr 2018 05:27:38 +0000 (13:27 +0800)
netsync/protocol_reactor.go
p2p/pex_reactor.go
p2p/switch.go

index df9ef09..cea17e2 100644 (file)
@@ -2,7 +2,6 @@ package netsync
 
 import (
        "reflect"
-       "strings"
        "sync"
        "time"
 
index 651262e..d42276f 100644 (file)
@@ -12,7 +12,7 @@ import (
        wire "github.com/tendermint/go-wire"
        cmn "github.com/tendermint/tmlibs/common"
 
-       "github.com/bytom/errors"  
+       "github.com/bytom/errors"
 )
 
 const (
@@ -292,8 +292,7 @@ func (r *PEXReactor) ensurePeers() {
 
        // Dial picked addresses
        for _, item := range toDial {
-               _, err := r.Switch.DialPeerWithAddress(item, false)
-               if err != nil {
+               if _, err := r.Switch.DialPeerWithAddress(item, false); err != nil {
                        r.book.MarkAttempt(item)
                }
        }
index a3a8f7f..9f98820 100644 (file)
@@ -7,14 +7,13 @@ import (
        "net"
        "sync"
        "time"
+       "strings"
 
        log "github.com/sirupsen/logrus"
        crypto "github.com/tendermint/go-crypto"
        cmn "github.com/tendermint/tmlibs/common"
        dbm "github.com/tendermint/tmlibs/db"
 
-       "strings"
-
        cfg "github.com/bytom/config"
        "github.com/bytom/errors"
        "github.com/bytom/p2p/trust"