"fmt"
"net"
- cfg "github.com/vapor/config"
- "github.com/vapor/consensus"
- "github.com/vapor/errors"
- "github.com/vapor/p2p/signlib"
- "github.com/vapor/version"
+ cfg "github.com/bytom/vapor/config"
+ "github.com/bytom/vapor/consensus"
+ "github.com/bytom/vapor/errors"
+ "github.com/bytom/vapor/p2p/signlib"
+ "github.com/bytom/vapor/version"
)
const maxNodeInfoSize = 10240 // 10Kb
return nil
}
+func (info NodeInfo) DoFilter(ip string, pubKey string) error {
+ if info.PubKey == pubKey {
+ return ErrConnectSelf
+ }
+
+ return nil
+}
+
//listenHost peer listener ip address
func (info NodeInfo) listenHost() string {
host, _, _ := net.SplitHostPort(info.ListenAddr)
}
//remoteAddrHost peer external ip address
-func (info NodeInfo) remoteAddrHost() string {
+func (info NodeInfo) RemoteAddrHost() string {
host, _, _ := net.SplitHostPort(info.RemoteAddr)
return host
}