Grab the remote peer's user agent.
This commit is contained in:
parent
59e2b204a3
commit
4f25d45e77
1 changed files with 4 additions and 0 deletions
4
peer.go
4
peer.go
|
@ -137,6 +137,7 @@ type peer struct {
|
|||
txProcessed chan bool
|
||||
blockProcessed chan bool
|
||||
quit chan bool
|
||||
userAgent string
|
||||
}
|
||||
|
||||
// String returns the peer's address and directionality as a human-readable
|
||||
|
@ -248,6 +249,9 @@ func (p *peer) handleVersionMsg(msg *btcwire.MsgVersion) {
|
|||
// advertised.
|
||||
p.services = msg.Services
|
||||
|
||||
// Set the remote peer's user agent.
|
||||
p.userAgent = msg.UserAgent
|
||||
|
||||
// Inbound connections.
|
||||
if p.inbound {
|
||||
// Send version.
|
||||
|
|
Loading…
Reference in a new issue