diff options
-rw-r--r-- | src/rpc/mining.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 38d7b1eb1e..33e234a95e 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -748,6 +748,10 @@ 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"); + } + uint256 hash = block.GetHash(); bool fBlockPresent = false; { |