Fix the --rpc_port command-line argument

The --rpc_port command-line option is effectively ignored. We construct
an `Endpoint` with the given port, but then drop it on the floor.
(Perhaps the author thought the `Endpoint::at_port` method is a mutation
instead of a transformation.) This small change adds the missing
assignment to hold on to the new endpoint.

Fixes #2764
This commit is contained in:
John Freeman
2018-11-19 09:02:41 -06:00
committed by Nik Bougalis
parent 30bba29da2
commit 412a3ec710

View File

@@ -620,7 +620,8 @@ int run (int argc, char** argv)
std::cerr << "WARNING: using deprecated rpc_port param.\n";
try
{
res.first.at_port(vm["rpc_port"].as<std::uint16_t>());
res.first = res.first.at_port(
vm["rpc_port"].as<std::uint16_t>());
if (res.first.port() == 0)
throw std::domain_error("0");
}