diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 4e52734a9..084f982d4 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -787,8 +787,14 @@ UniValue submitblock(const JSONRPCRequest& request) if (!DecodeHexBlk(block, request.params[0].get_str())) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block decode failed"); - if (block.vtx.empty() || !block.vtx[0]->IsCoinBase()) { - throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block does not start with a coinbase"); + if (block.vtx.empty()) + { + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block does not contain a coinbase transaction"); + } + + if (!block.vtx[0]->IsCoinBase()) + { + throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "Block does not start with a valid coinbase transaction"); } uint256 hash = block.GetHash();