aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-cli.cpp
diff options
context:
space:
mode:
authorMatthew Zipkin <pinheadmz@gmail.com>2023-07-07 14:41:23 -0400
committerMatthew Zipkin <pinheadmz@gmail.com>2024-05-14 10:39:43 -0400
commit466b90562f4785de74b548f7c4a256069e2aaf43 (patch)
treeb911c6d48f8bf93c91b1c39f210a67bc8c2efee5 /src/bitcoin-cli.cpp
parent2ca1460ae3a7217eaa8c5972515bf622bedadfce (diff)
rpc: Add "jsonrpc" field and drop null "result"/"error" fields
Only for JSON-RPC 2.0 requests.
Diffstat (limited to 'src/bitcoin-cli.cpp')
-rw-r--r--src/bitcoin-cli.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp
index 3591f7248b..0bafb4f645 100644
--- a/src/bitcoin-cli.cpp
+++ b/src/bitcoin-cli.cpp
@@ -302,7 +302,7 @@ public:
}
addresses.pushKV("total", total);
result.pushKV("addresses_known", addresses);
- return JSONRPCReplyObj(std::move(result), NullUniValue, 1);
+ return JSONRPCReplyObj(std::move(result), NullUniValue, /*id=*/1, JSONRPCVersion::V1_LEGACY);
}
};
@@ -371,7 +371,7 @@ public:
}
result.pushKV("relayfee", batch[ID_NETWORKINFO]["result"]["relayfee"]);
result.pushKV("warnings", batch[ID_NETWORKINFO]["result"]["warnings"]);
- return JSONRPCReplyObj(std::move(result), NullUniValue, 1);
+ return JSONRPCReplyObj(std::move(result), NullUniValue, /*id=*/1, JSONRPCVersion::V1_LEGACY);
}
};
@@ -623,7 +623,7 @@ public:
}
}
- return JSONRPCReplyObj(UniValue{result}, NullUniValue, 1);
+ return JSONRPCReplyObj(UniValue{result}, NullUniValue, /*id=*/1, JSONRPCVersion::V1_LEGACY);
}
const std::string m_help_doc{
@@ -709,7 +709,7 @@ public:
UniValue result(UniValue::VOBJ);
result.pushKV("address", address_str);
result.pushKV("blocks", reply.get_obj()["result"]);
- return JSONRPCReplyObj(std::move(result), NullUniValue, 1);
+ return JSONRPCReplyObj(std::move(result), NullUniValue, /*id=*/1, JSONRPCVersion::V1_LEGACY);
}
protected:
std::string address_str;