cli: Add warning for duplicate port definition

Adds a warning when both -rpcconnect and -rpcport define
a port to be used.
This commit is contained in:
tdb3 2024-04-27 18:10:57 -04:00
parent e208fb5d3b
commit 24bc46c83b
No known key found for this signature in database

View file

@ -770,6 +770,12 @@ static UniValue CallRPC(BaseRequestHandler* rh, const std::string& strMethod, co
// Use the valid port provided
port = rpcport_int;
// If there was a valid port provided in rpcconnect,
// rpcconnect_port is non-zero.
if (rpcconnect_port != 0) {
tfm::format(std::cerr, "Warning: Port specified in both -rpcconnect and -rpcport. Using -rpcport %u\n", port);
}
}
}