Skip to content

Commit

Permalink
interfaces: remove now unused 'use_upnp' arg from 'mapPort'
Browse files Browse the repository at this point in the history
  • Loading branch information
darosior committed Oct 24, 2024
1 parent 038bbe7 commit a5fcfb7
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class Node
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;
Expand Down
2 changes: 1 addition & 1 deletion src/mapport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/mapport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/node/interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class NodeImpl : public Node
});
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
{
Expand Down
2 changes: 1 addition & 1 deletion src/qt/optionsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a5fcfb7

Please sign in to comment.