mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-20 11:57:51 +01:00
Add PortForward setting to override external listening port. Improve default config inline documentation.
Prepare EnableUPnP setting.
This commit is contained in:
@@ -286,7 +286,11 @@ func setAnnouncementPorts(packet *PacketRaw, n *Network) {
|
||||
// UPnP: The port is forwarded automatically.
|
||||
// Manual override in config: The user can specify a (global) incoming port that must be open on all listening IPs.
|
||||
// This external port will be then passed onto other peers who will use it to connect.
|
||||
portE := n.externalPort
|
||||
portE := n.portExternal
|
||||
|
||||
if config.PortForward > 0 {
|
||||
portE = config.PortForward
|
||||
}
|
||||
|
||||
binary.LittleEndian.PutUint16(packet.Payload[15:17], portI)
|
||||
binary.LittleEndian.PutUint16(packet.Payload[17:19], portE)
|
||||
|
||||
Reference in New Issue
Block a user