mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-29 10:16:45 +00:00
28 lines
679 B
Go
28 lines
679 B
Go
package addressmanager
|
|
|
|
import (
|
|
"net"
|
|
|
|
"github.com/fabbez/topiad/infrastructure/config"
|
|
)
|
|
|
|
// Config is a descriptor which specifies the AddressManager instance configuration.
|
|
type Config struct {
|
|
AcceptUnroutable bool
|
|
DefaultPort string
|
|
ExternalIPs []string
|
|
Listeners []string
|
|
Lookup func(string) ([]net.IP, error)
|
|
}
|
|
|
|
// NewConfig returns a new address manager Config.
|
|
func NewConfig(cfg *config.Config) *Config {
|
|
return &Config{
|
|
AcceptUnroutable: cfg.NetParams().AcceptUnroutable,
|
|
DefaultPort: cfg.NetParams().DefaultPort,
|
|
ExternalIPs: cfg.ExternalIPs,
|
|
Listeners: cfg.Listeners,
|
|
Lookup: cfg.Lookup,
|
|
}
|
|
}
|