mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Add special error for genesis coinbase to gettransaction
This commit is contained in:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user