From 1adf82ac394ca16308e1004495b76529d54018ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Tim=C3=B3n?= Date: Sat, 5 Nov 2016 01:54:00 +0100 Subject: [PATCH] RPC: Give more details when "generate" fails --- src/rpc/mining.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 3e91a79a649..8824898febd 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -133,7 +133,7 @@ UniValue generateBlocks(boost::shared_ptr coinbaseScript, int nG } CValidationState state; if (!ProcessNewBlock(state, Params(), NULL, pblock, true, NULL, false)) - throw JSONRPCError(RPC_INTERNAL_ERROR, "ProcessNewBlock, block not accepted"); + throw JSONRPCError(RPC_INTERNAL_ERROR, strprintf("ProcessNewBlock: block not accepted: %s", FormatStateMessage(state))); ++nHeight; blockHashes.push_back(pblock->GetHash().GetHex());