Merge #9087: RPC: why not give more details when "generate" fails?

1adf82a RPC: Give more details when "generate" fails (Jorge Timón)
This commit is contained in:
MarcoFalke 2016-11-08 15:55:41 +01:00
commit 924de0bd75
No known key found for this signature in database
GPG key ID: 2D7F2372E50FE137

View file

@ -133,7 +133,7 @@ UniValue generateBlocks(boost::shared_ptr<CReserveScript> 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());