aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorMeshCollider <dobsonsa68@gmail.com>2018-01-27 20:10:56 +1300
committerMeshCollider <dobsonsa68@gmail.com>2018-01-30 11:36:25 +1300
commitee1112122932151cee06b28ef724e0726849391b (patch)
treea124dac2f863b4ac4f768cdceb8a83f7a6efd967 /src/rpc
parent2ae7cf8ef5be67e085abc1b1dc71bc44865a71b3 (diff)
Add special error for genesis coinbase to gettransaction
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/rawtransaction.cpp5
1 files changed, 5 insertions, 0 deletions
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()) {