mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 09:02:28 +00:00
network: add ability to specify port for P2P version exchange
This commit is contained in:
parent
5924123927
commit
09bb162de0
3 changed files with 13 additions and 2 deletions
|
@ -31,7 +31,10 @@ type (
|
|||
// Address. Example: "127.0.0.1".
|
||||
Address string
|
||||
|
||||
// Port. Example: 20332.
|
||||
// AnnouncedPort is an announced node port for P2P version exchange.
|
||||
AnnouncedPort uint16
|
||||
|
||||
// Port is the actual node port it is bound to. Example: 20332.
|
||||
Port uint16
|
||||
|
||||
// The network mode the server will operate on.
|
||||
|
@ -92,6 +95,7 @@ func NewServerConfig(cfg config.Config) ServerConfig {
|
|||
return ServerConfig{
|
||||
UserAgent: cfg.GenerateUserAgent(),
|
||||
Address: appConfig.Address,
|
||||
AnnouncedPort: appConfig.AnnouncedNodePort,
|
||||
Port: appConfig.NodePort,
|
||||
Net: protoConfig.Magic,
|
||||
Relay: appConfig.Relay,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue