aboutsummaryrefslogtreecommitdiff
path: root/src/rpcmining.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpcmining.cpp')
-rw-r--r--src/rpcmining.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp
index 851d113f3b..24b865150a 100644
--- a/src/rpcmining.cpp
+++ b/src/rpcmining.cpp
@@ -5,11 +5,12 @@
#include "amount.h"
#include "chainparams.h"
+#include "consensus/consensus.h"
#include "core_io.h"
#include "init.h"
-#include "net.h"
#include "main.h"
#include "miner.h"
+#include "net.h"
#include "pow.h"
#include "rpcserver.h"
#include "util.h"
@@ -196,6 +197,8 @@ Value setgenerate(const Array& params, bool fHelp)
if (pwalletMain == NULL)
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Method not found (disabled)");
+ if (Params().MineBlocksOnDemand())
+ throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Use the generate method instead of setgenerate on this network");
bool fGenerate = true;
if (params.size() > 0)