Browse Source

RPC: Give more details when "generate" fails

0.14
Jorge Timón 8 years ago
parent
commit
1adf82ac39
No known key found for this signature in database
GPG Key ID: 8866C18EA1C944A2
  1. 2
      src/rpc/mining.cpp

2
src/rpc/mining.cpp

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

Loading…
Cancel
Save