diff --git a/src/init.cpp b/src/init.cpp index be9b11c6ae3..587e7cb42b5 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1827,7 +1827,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) if (node.peerman) node.peerman->SetBestBlock(chain_active_height, std::chrono::seconds{best_block_time}); // Map ports with NAT-PMP - StartMapPort(false, args.GetBoolArg("-natpmp", DEFAULT_NATPMP)); + StartMapPort(args.GetBoolArg("-natpmp", DEFAULT_NATPMP)); CConnman::Options connOptions; connOptions.m_local_services = g_local_services; diff --git a/src/interfaces/node.h b/src/interfaces/node.h index 91a623a65d6..aebb4386511 100644 --- a/src/interfaces/node.h +++ b/src/interfaces/node.h @@ -121,7 +121,7 @@ public: virtual void resetSettings() = 0; //! Map port. - virtual void mapPort(bool use_upnp, bool use_pcp) = 0; + virtual void mapPort(bool use_pcp) = 0; //! Get proxy. virtual bool getProxy(Network net, Proxy& proxy_info) = 0; diff --git a/src/mapport.cpp b/src/mapport.cpp index 5d57f8dbb8f..cd8297c8445 100644 --- a/src/mapport.cpp +++ b/src/mapport.cpp @@ -190,7 +190,7 @@ static void MapPortProtoSetEnabled(MapPortProtoFlag proto, bool enabled) } } -void StartMapPort(bool use_upnp, bool use_pcp) +void StartMapPort(bool use_pcp) { MapPortProtoSetEnabled(MapPortProtoFlag::PCP, use_pcp); DispatchMapPort(); diff --git a/src/mapport.h b/src/mapport.h index e6348e88dc8..8e33ede32f6 100644 --- a/src/mapport.h +++ b/src/mapport.h @@ -13,7 +13,7 @@ enum MapPortProtoFlag : unsigned int { PCP = 0x02, // PCP with NAT-PMP fallback. }; -void StartMapPort(bool use_upnp, bool use_pcp); +void StartMapPort(bool use_pcp); void InterruptMapPort(); void StopMapPort(); diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index 0010c104a88..f42f6ff1efb 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -187,7 +187,7 @@ public: }); args().WriteSettingsFile(); } - void mapPort(bool use_upnp, bool use_pcp) override { StartMapPort(use_upnp, use_pcp); } + void mapPort(bool use_pcp) override { StartMapPort(use_pcp); } bool getProxy(Network net, Proxy& proxy_info) override { return GetProxy(net, proxy_info); } size_t getNodeCount(ConnectionDirection flags) override { diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index acaa02aa858..a1dbc6248c0 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -526,7 +526,7 @@ bool OptionsModel::setOption(OptionID option, const QVariant& value, const std:: case MapPortNatpmp: // core option - can be changed on-the-fly if (changed()) { update(value.toBool()); - node().mapPort(false, value.toBool()); + node().mapPort(value.toBool()); } break; case MinimizeOnClose: