Skip to content

Commit 1adf82a

Browse files
committed
RPC: Give more details when "generate" fails
1 parent 4e57824 commit 1adf82a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rpc/mining.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ UniValue generateBlocks(boost::shared_ptr<CReserveScript> coinbaseScript, int nG
133133
}
134134
CValidationState state;
135135
if (!ProcessNewBlock(state, Params(), NULL, pblock, true, NULL, false))
136-
throw JSONRPCError(RPC_INTERNAL_ERROR, "ProcessNewBlock, block not accepted");
136+
throw JSONRPCError(RPC_INTERNAL_ERROR, strprintf("ProcessNewBlock: block not accepted: %s", FormatStateMessage(state)));
137137
++nHeight;
138138
blockHashes.push_back(pblock->GetHash().GetHex());
139139

0 commit comments

Comments
 (0)