Grab the remote peer's user agent.

This commit is contained in:
David Hill 2013-10-29 16:25:08 -04:00 committed by Owain G. Ainsworth
parent 59e2b204a3
commit 4f25d45e77

View file

@ -137,6 +137,7 @@ type peer struct {
txProcessed chan bool txProcessed chan bool
blockProcessed chan bool blockProcessed chan bool
quit chan bool quit chan bool
userAgent string
} }
// String returns the peer's address and directionality as a human-readable // String returns the peer's address and directionality as a human-readable
@ -248,6 +249,9 @@ func (p *peer) handleVersionMsg(msg *btcwire.MsgVersion) {
// advertised. // advertised.
p.services = msg.Services p.services = msg.Services
// Set the remote peer's user agent.
p.userAgent = msg.UserAgent
// Inbound connections. // Inbound connections.
if p.inbound { if p.inbound {
// Send version. // Send version.