diff options
Diffstat (limited to 'src/rpc')
-rw-r--r-- | src/rpc/client.cpp | 2 | ||||
-rw-r--r-- | src/rpc/net.cpp | 2 | ||||
-rw-r--r-- | src/rpc/rawtransaction.cpp | 5 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp index f63e970bdd..b88c1bccd5 100644 --- a/src/rpc/client.cpp +++ b/src/rpc/client.cpp @@ -213,7 +213,7 @@ UniValue RPCConvertNamedValues(const std::string &strMethod, const std::vector<s UniValue params(UniValue::VOBJ); for (const std::string &s: strParams) { - size_t pos = s.find("="); + size_t pos = s.find('='); if (pos == std::string::npos) { throw(std::runtime_error("No '=' in named argument '"+s+"', this needs to be present for every argument (even if it is empty)")); } diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index a81b651981..59b376c59a 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -516,7 +516,7 @@ UniValue setban(const JSONRPCRequest& request) CNetAddr netAddr; bool isSubnet = false; - if (request.params[0].get_str().find("/") != std::string::npos) + if (request.params[0].get_str().find('/') != std::string::npos) isSubnet = true; if (!isSubnet) { diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 82399e1567..00e73675b4 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -147,6 +147,11 @@ UniValue getrawtransaction(const JSONRPCRequest& request) uint256 hash = ParseHashV(request.params[0], "parameter 1"); CBlockIndex* blockindex = nullptr; + if (hash == Params().GenesisBlock().hashMerkleRoot) { + // Special exception for the genesis block coinbase transaction + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "The genesis block coinbase is not considered an ordinary transaction and cannot be retrieved"); + } + // Accept either a bool (true) or a num (>=1) to indicate verbose output. bool fVerbose = false; if (!request.params[1].isNull()) { |