aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/peer.go
diff options
context:
space:
mode:
authorDaniel A. Nagy <nagy.da@gmail.com>2015-05-08 23:55:53 +0800
committerDaniel A. Nagy <nagy.da@gmail.com>2015-05-08 23:55:53 +0800
commit62dd9833ec768e2026bccb1cf7a8ef4263b9286d (patch)
tree0a091d99afd7f8cf5e3a6d4522c30ceef8559a55 /p2p/peer.go
parent3a01e3e39b9ce83ecb7444319407ee8bb00e3bf6 (diff)
parentc8fc4cebe63073fd77d5f553a4f0cec36a4ccb4b (diff)
downloaddexon-62dd9833ec768e2026bccb1cf7a8ef4263b9286d.tar
dexon-62dd9833ec768e2026bccb1cf7a8ef4263b9286d.tar.gz
dexon-62dd9833ec768e2026bccb1cf7a8ef4263b9286d.tar.bz2
dexon-62dd9833ec768e2026bccb1cf7a8ef4263b9286d.tar.lz
dexon-62dd9833ec768e2026bccb1cf7a8ef4263b9286d.tar.xz
dexon-62dd9833ec768e2026bccb1cf7a8ef4263b9286d.tar.zst
dexon-62dd9833ec768e2026bccb1cf7a8ef4263b9286d.zip
Merge branch 'develop' of github.com:ethereum/go-ethereum into develop
Diffstat (limited to 'p2p/peer.go')
-rw-r--r--p2p/peer.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/p2p/peer.go b/p2p/peer.go
index cdf9ba965..ac691f2ce 100644
--- a/p2p/peer.go
+++ b/p2p/peer.go
@@ -211,6 +211,18 @@ func (p *Peer) handle(msg Msg) error {
return nil
}
+func countMatchingProtocols(protocols []Protocol, caps []Cap) int {
+ n := 0
+ for _, cap := range caps {
+ for _, proto := range protocols {
+ if proto.Name == cap.Name && proto.Version == cap.Version {
+ n++
+ }
+ }
+ }
+ return n
+}
+
// matchProtocols creates structures for matching named subprotocols.
func matchProtocols(protocols []Protocol, caps []Cap, rw MsgReadWriter) map[string]*protoRW {
sort.Sort(capsByName(caps))