mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
set up p.na before preparing our reply version message.
Means we can use that instead of generating another (next commit).
This commit is contained in:
parent
c8e88d383e
commit
a3d783e9e8
16
peer.go
16
peer.go
@ -254,14 +254,6 @@ func (p *peer) handleVersionMsg(msg *btcwire.MsgVersion) {
|
||||
|
||||
// Inbound connections.
|
||||
if p.inbound {
|
||||
// Send version.
|
||||
err := p.pushVersionMsg()
|
||||
if err != nil {
|
||||
p.logError("Can't send version message: %v", err)
|
||||
p.Disconnect()
|
||||
return
|
||||
}
|
||||
|
||||
// Set up a NetAddress for the peer to be used with AddrManager.
|
||||
// We only do this inbound because outbound set this up
|
||||
// at connection time and no point recomputing.
|
||||
@ -272,6 +264,14 @@ func (p *peer) handleVersionMsg(msg *btcwire.MsgVersion) {
|
||||
return
|
||||
}
|
||||
p.na = na
|
||||
|
||||
// Send version.
|
||||
err = p.pushVersionMsg()
|
||||
if err != nil {
|
||||
p.logError("Can't send version message: %v", err)
|
||||
p.Disconnect()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Send verack.
|
||||
|
Loading…
x
Reference in New Issue
Block a user