Skip to content

Commit 24bc46c

Browse files
committed
cli: Add warning for duplicate port definition
Adds a warning when both -rpcconnect and -rpcport define a port to be used.
1 parent e208fb5 commit 24bc46c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bitcoin-cli.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,12 @@ static UniValue CallRPC(BaseRequestHandler* rh, const std::string& strMethod, co
770770

771771
// Use the valid port provided
772772
port = rpcport_int;
773+
774+
// If there was a valid port provided in rpcconnect,
775+
// rpcconnect_port is non-zero.
776+
if (rpcconnect_port != 0) {
777+
tfm::format(std::cerr, "Warning: Port specified in both -rpcconnect and -rpcport. Using -rpcport %u\n", port);
778+
}
773779
}
774780
}
775781

0 commit comments

Comments
 (0)