identify: also match observed against listening addresses
@@ -383,7 +383,8 @@ func (oas *ObservedAddrManager) maybeRecordObservation(conn network.Conn, observ
// We should reject the connection if the observation doesn't match the
// transports of one of our advertised addresses.
- if !HasConsistentTransport(observed, oas.host.Addrs()) {
+ if !HasConsistentTransport(observed, oas.host.Addrs()) &&
+ !HasConsistentTransport(observed, oas.host.Network().ListenAddresses()) {
log.Debugw(
"observed multiaddr doesn't match the transports of any announced addresses",
"from", conn.RemoteMultiaddr(),
