Skip to content

Commit

Permalink
cli: Add warning for duplicate port definition
Browse files Browse the repository at this point in the history
Adds a warning when both -rpcconnect and -rpcport define
a port to be used.
  • Loading branch information
tdb3 committed Mar 12, 2024
1 parent 2cc471e commit 6e779d8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bitcoin-cli.cpp
Expand Up @@ -768,6 +768,12 @@ static UniValue CallRPC(BaseRequestHandler* rh, const std::string& strMethod, co

// Use the valid port provided
port = rpcport_port.value();

// 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);
}
}
}

Expand Down

0 comments on commit 6e779d8

Please sign in to comment.