// Copyright 2020 The Swarm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
packagelibp2p
import(
"errors"
"strings"
"github.com/libp2p/go-libp2p-core/host"
libp2ppeer"github.com/libp2p/go-libp2p-core/peer"
ma"github.com/multiformats/go-multiaddr"
)
typeUpnpAddressResolverstruct{
hosthost.Host
}
// Resolve checks if there is a possible better advertisable underlay then the provided observed address.
// In some NAT situations, for example in the case when nodes are behind upnp, observer might send the observed address with a wrong port.
// In this case, observed address is compared to addresses provided by host, and if there is a same address but with different port, that one is used as advertisable address instead of provided observed one.
// TODO: this is a quickfix and it will be improved in the future