diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-11-24 20:48:47 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-11-24 20:48:47 +0800 |
commit | 5490437942967638bcc6198035315f6811febaa8 (patch) | |
tree | ec4fbee454bacbf2b80b5a7ff402fb48dd2c10cf /p2p/protocol.go | |
parent | e5532154a50114d5ffb1ffd850b746cab00cb899 (diff) | |
parent | b0fb48c389460193d9fc0a5118d79ff6dec48ce0 (diff) | |
download | go-tangerine-1.3.2.tar go-tangerine-1.3.2.tar.gz go-tangerine-1.3.2.tar.bz2 go-tangerine-1.3.2.tar.lz go-tangerine-1.3.2.tar.xz go-tangerine-1.3.2.tar.zst go-tangerine-1.3.2.zip |
Merge branch 'develop' into release/1.3.2v1.3.2
Conflicts:
VERSION
cmd/geth/main.go
Diffstat (limited to 'p2p/protocol.go')
-rw-r--r-- | p2p/protocol.go | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/p2p/protocol.go b/p2p/protocol.go index ac0c3d942..ee747ba23 100644 --- a/p2p/protocol.go +++ b/p2p/protocol.go @@ -16,7 +16,11 @@ package p2p -import "fmt" +import ( + "fmt" + + "github.com/ethereum/go-ethereum/p2p/discover" +) // Protocol represents a P2P subprotocol implementation. type Protocol struct { @@ -39,6 +43,15 @@ type Protocol struct { // any protocol-level error (such as an I/O error) that is // encountered. Run func(peer *Peer, rw MsgReadWriter) error + + // NodeInfo is an optional helper method to retrieve protocol specific metadata + // about the host node. + NodeInfo func() interface{} + + // PeerInfo is an optional helper method to retrieve protocol specific metadata + // about a certain peer in the network. If an info retrieval function is set, + // but returns nil, it is assumed that the protocol handshake is still running. + PeerInfo func(id discover.NodeID) interface{} } func (p Protocol) cap() Cap { |