OSDN Git Service

Add p2p security module (#143)
[bytom/vapor.git] / p2p / node_info.go
index 00f818d..e602a0d 100644 (file)
@@ -71,6 +71,14 @@ func (info *NodeInfo) compatibleWith(other *NodeInfo, versionCompatibleWith Vers
        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)