Browse Source

reconnect to self-reported address if persistent peer is inbound (#2031)

* reconnect to self-reported address if persistent peer is inbound

* add a fixme
pull/2029/head
Anton Kaliaev 7 years ago
committed by GitHub
parent
commit
9962e598a0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      p2p/switch.go

+ 3
- 1
p2p/switch.go View File

@ -283,7 +283,9 @@ func (sw *Switch) StopPeerForError(peer Peer, reason interface{}) {
if peer.IsPersistent() {
addr := peer.OriginalAddr()
if addr == nil {
panic(fmt.Sprintf("persistent peer %v with no original address", peer))
// FIXME: persistent peers can't be inbound right now.
// self-reported address for inbound persistent peers
addr = peer.NodeInfo().NetAddress()
}
go sw.reconnectToPeer(addr)
}


Loading…
Cancel
Save