Skip to content

Commit 734f80a

Browse files
committed
Merge pull request #6039
27ce808 tests: Error when setgenerate is used on regtest (Wladimir J. van der Laan)
2 parents cf7adad + 27ce808 commit 734f80a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/rpcmining.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ Value setgenerate(const Array& params, bool fHelp)
196196

197197
if (pwalletMain == NULL)
198198
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Method not found (disabled)");
199+
if (Params().MineBlocksOnDemand())
200+
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Use the generate method instead of setgenerate on this network");
199201

200202
bool fGenerate = true;
201203
if (params.size() > 0)

0 commit comments

Comments
 (0)