Commit 4bef3ce2 authored by Felix Lange's avatar Felix Lange

p2p: print Cap as name/version

parent 49a739c8
package p2p
import "fmt"
// Protocol represents a P2P subprotocol implementation.
type Protocol struct {
// Name should contain the official protocol name,
......@@ -37,6 +39,10 @@ func (cap Cap) RlpData() interface{} {
return []interface{}{cap.Name, cap.Version}
}
func (cap Cap) String() string {
return fmt.Sprintf("%s/%d", cap.Name, cap.Version)
}
type capsByName []Cap
func (cs capsByName) Len() int { return len(cs) }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment