Skip to content

Commit 7696841

Browse files
committed
Fix style in -stdin and -stdinrpcpass handling
1 parent 66a5b41 commit 7696841

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/bitcoin-cli.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,19 +296,22 @@ int CommandLineRPC(int argc, char *argv[])
296296
}
297297
std::string rpcPass;
298298
if (gArgs.GetBoolArg("-stdinrpcpass", false)) {
299-
if(!std::getline(std::cin,rpcPass))
299+
if (!std::getline(std::cin, rpcPass)) {
300300
throw std::runtime_error("-stdinrpcpass specified but failed to read from standard input");
301+
}
301302
gArgs.ForceSetArg("-rpcpassword", rpcPass);
302303
}
303304
std::vector<std::string> args = std::vector<std::string>(&argv[1], &argv[argc]);
304305
if (gArgs.GetBoolArg("-stdin", false)) {
305306
// Read one arg per line from stdin and append
306307
std::string line;
307-
while (std::getline(std::cin,line))
308+
while (std::getline(std::cin, line)) {
308309
args.push_back(line);
310+
}
309311
}
310-
if (args.size() < 1)
312+
if (args.size() < 1) {
311313
throw std::runtime_error("too few parameters (need at least command)");
314+
}
312315
std::string strMethod = args[0];
313316
args.erase(args.begin()); // Remove trailing method name from arguments vector
314317

0 commit comments

Comments
 (0)