Add IP address to a few more peer error messages.
This commit adds the peer IP to a few more error messages as originally noted by #102.
This commit is contained in:
parent
ce2f68a982
commit
91e563edaa
1 changed files with 4 additions and 3 deletions
7
peer.go
7
peer.go
|
@ -303,7 +303,8 @@ func (p *peer) handleVersionMsg(msg *btcwire.MsgVersion) {
|
||||||
// Send version.
|
// Send version.
|
||||||
err = p.pushVersionMsg()
|
err = p.pushVersionMsg()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.logError("Can't send version message: %v", err)
|
p.logError("Can't send version message to %s: %v",
|
||||||
|
p.addr, err)
|
||||||
p.Disconnect()
|
p.Disconnect()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -827,7 +828,7 @@ func (p *peer) handleGetAddrMsg(msg *btcwire.MsgGetAddr) {
|
||||||
// Push the addresses.
|
// Push the addresses.
|
||||||
err := p.pushAddrMsg(addrCache)
|
err := p.pushAddrMsg(addrCache)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.logError("Can't push address message: %v", err)
|
p.logError("Can't push address message to %s: %v", p.addr, err)
|
||||||
p.Disconnect()
|
p.Disconnect()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -1028,7 +1029,7 @@ func (p *peer) writeMessage(msg btcwire.Message) {
|
||||||
p.server.AddBytesSent(uint64(n))
|
p.server.AddBytesSent(uint64(n))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.Disconnect()
|
p.Disconnect()
|
||||||
p.logError("Can't send message: %v", err)
|
p.logError("Can't send message to %s: %v", p.addr, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue