diff options
author | obscuren <geffobscura@gmail.com> | 2015-02-14 07:27:46 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-02-14 07:27:46 +0800 |
commit | 65159d65c8c830342b3b1ca666571997209826c5 (patch) | |
tree | 195fe0e67d1da523c74c2f971637798e75088741 /p2p | |
parent | 84f7c966f725ef0f5c62b4427857d112c0d1e828 (diff) | |
parent | 3ff6c9bb7951e306cc78231f7703fb21e369608e (diff) | |
download | dexon-65159d65c8c830342b3b1ca666571997209826c5.tar dexon-65159d65c8c830342b3b1ca666571997209826c5.tar.gz dexon-65159d65c8c830342b3b1ca666571997209826c5.tar.bz2 dexon-65159d65c8c830342b3b1ca666571997209826c5.tar.lz dexon-65159d65c8c830342b3b1ca666571997209826c5.tar.xz dexon-65159d65c8c830342b3b1ca666571997209826c5.tar.zst dexon-65159d65c8c830342b3b1ca666571997209826c5.zip |
Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop
Diffstat (limited to 'p2p')
-rw-r--r-- | p2p/protocol.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/p2p/protocol.go b/p2p/protocol.go index fe359fc54..5fa395eda 100644 --- a/p2p/protocol.go +++ b/p2p/protocol.go @@ -1,5 +1,7 @@ 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) } |