OSDN Git Service

Format netsync module code directory (#88)
[bytom/vapor.git] / p2p / switch.go
index d70fa75..57b16cf 100644 (file)
@@ -293,6 +293,10 @@ func (sw *Switch) DialPeerWithAddress(addr *NetAddress) error {
        return nil
 }
 
+func (sw *Switch) ID() [32]byte {
+       return sw.nodeInfo.PubKey
+}
+
 //IsDialing prevent duplicate dialing
 func (sw *Switch) IsDialing(addr *NetAddress) bool {
        return sw.dialing.Has(addr.IP.String())