Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115138
D5112.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D5112.diff
View Options
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp
--- a/src/bitcoin-cli.cpp
+++ b/src/bitcoin-cli.cpp
@@ -251,7 +251,9 @@
if (buf) {
size_t size = evbuffer_get_length(buf);
const char *data = (const char *)evbuffer_pullup(buf, size);
- if (data) reply->body = std::string(data, size);
+ if (data) {
+ reply->body = std::string(data, size);
+ }
evbuffer_drain(buf, size);
}
}
@@ -396,7 +398,9 @@
HTTPReply response;
raii_evhttp_request req =
obtain_evhttp_request(http_request_done, (void *)&response);
- if (req == nullptr) throw std::runtime_error("create http request failed");
+ if (req == nullptr) {
+ throw std::runtime_error("create http request failed");
+ }
#if LIBEVENT_VERSION_NUMBER >= 0x02010300
evhttp_request_set_error_cb(req.get(), http_error_cb);
#endif
@@ -513,9 +517,10 @@
}
std::string rpcPass;
if (gArgs.GetBoolArg("-stdinrpcpass", false)) {
- if (!std::getline(std::cin, rpcPass))
+ if (!std::getline(std::cin, rpcPass)) {
throw std::runtime_error("-stdinrpcpass specified but failed "
"to read from standard input");
+ }
gArgs.ForceSetArg("-rpcpassword", rpcPass);
}
std::vector<std::string> args =
@@ -556,8 +561,9 @@
if (!error.isNull()) {
// Error
int code = error["code"].get_int();
- if (fWait && code == RPC_IN_WARMUP)
+ if (fWait && code == RPC_IN_WARMUP) {
throw CConnectionFailed("server in warmup");
+ }
strPrint = "error: " + error.write();
nRet = abs(code);
if (error.isObject()) {
diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp
--- a/src/bitcoin-tx.cpp
+++ b/src/bitcoin-tx.cpp
@@ -458,8 +458,9 @@
// separate VALUE:SCRIPT[:FLAGS]
std::vector<std::string> vStrInputParts;
boost::split(vStrInputParts, strInput, boost::is_any_of(":"));
- if (vStrInputParts.size() < 2)
+ if (vStrInputParts.size() < 2) {
throw std::runtime_error("TX output missing separator");
+ }
// Extract and validate VALUE
Amount value = ExtractAndValidateValue(vStrInputParts[0]);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 1, 09:56 (3 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187271
Default Alt Text
D5112.diff (2 KB)
Attached To
D5112: Add braces to bitcoin-tx and bitcoin-cli
Event Timeline
Log In to Comment