mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-21 05:26:46 +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.
|
// Inbound connections.
|
||||||
if p.inbound {
|
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.
|
// Set up a NetAddress for the peer to be used with AddrManager.
|
||||||
// We only do this inbound because outbound set this up
|
// We only do this inbound because outbound set this up
|
||||||
// at connection time and no point recomputing.
|
// at connection time and no point recomputing.
|
||||||
@ -272,6 +264,14 @@ func (p *peer) handleVersionMsg(msg *btcwire.MsgVersion) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
p.na = na
|
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.
|
// Send verack.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user