mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-10-14 00:59:33 +00:00
Grab the remote peer's user agent.
This commit is contained in:
parent
59e2b204a3
commit
4f25d45e77
4
peer.go
4
peer.go
@ -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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user