Browse Source

log error when we fail to add new address

pull/1350/head
Anton Kaliaev 7 years ago
parent
commit
34b77fcad4
No known key found for this signature in database GPG Key ID: 7B6881D965918214
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      p2p/pex/pex_reactor.go

+ 8
- 2
p2p/pex/pex_reactor.go View File

@ -164,7 +164,10 @@ func (r *PEXReactor) AddPeer(p Peer) {
// peers when we need - we don't trust inbound peers as much.
addr := p.NodeInfo().NetAddress()
if !isAddrPrivate(addr, r.config.PrivatePeerIDs) {
r.book.AddAddress(addr, addr)
err := r.book.AddAddress(addr, addr)
if err != nil {
r.Logger.Error("Failed to add new address", "err", err)
}
}
}
}
@ -265,7 +268,10 @@ func (r *PEXReactor) ReceiveAddrs(addrs []*p2p.NetAddress, src Peer) error {
srcAddr := src.NodeInfo().NetAddress()
for _, netAddr := range addrs {
if netAddr != nil && !isAddrPrivate(netAddr, r.config.PrivatePeerIDs) {
r.book.AddAddress(netAddr, srcAddr)
err := r.book.AddAddress(netAddr, srcAddr)
if err != nil {
r.Logger.Error("Failed to add new address", "err", err)
}
}
}
return nil


Loading…
Cancel
Save