diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index c1d45c6e7..975154cdf 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -218,7 +218,18 @@ UniValue generate(const UniValue& params, bool fHelp) #endif } if (!Params().MineBlocksOnDemand()) - throw JSONRPCError(RPC_METHOD_NOT_FOUND, "This method can only be used on regtest"); + { + if ( params[0].get_int() == 1 ) + { + mapArgs["disablemining"] = "1"; + throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Mining Disabled"); + } + else + { + mapArgs["disablemining"] = "0"; + throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Mining Enabled"); + } + } int nHeightStart = 0; int nHeightEnd = 0; @@ -576,6 +587,9 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) throw JSONRPCError(RPC_METHOD_NOT_FOUND, "komodod compiled without wallet and -mineraddress not set"); #endif } + + if ( GetArg("disablemining",false) ) + throw JSONRPCError(RPC_TYPE_ERROR, "Mining is Disabled"); UniValue lpval = NullUniValue; // TODO: Re-enable coinbasevalue once a specification has been written diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index d0dd65c41..bda9da062 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -119,7 +119,7 @@ UniValue getiguanajson(const UniValue& params, bool fHelp) notaries.push_back(notary); } - // get the min sigs .. this always rounds UP so mine sigs in iguana is +1 min sigs in komodod, due to some rounding error. + // get the min sigs .. this always rounds UP so min sigs in iguana is +1 min sigs in komodod, due to some rounding error. int minsigs; if ( num_notaries_STAKED[era]/5 > overrideMinSigs ) minsigs = (num_notaries_STAKED[era] / 5) + 1;