Allow setmocktime in regtest

Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
This commit is contained in:
Anthony Fieroni 2020-02-13 17:37:33 +02:00
parent 9b17209c44
commit b4bc48552c

View file

@ -350,7 +350,7 @@ static UniValue setmocktime(const JSONRPCRequest& request)
RPCExamples{""},
}.Check(request);
if (!Params().MineBlocksOnDemand())
if (Params().NetworkIDString() != CBaseChainParams::REGTEST)
throw std::runtime_error("setmocktime for regression testing (-regtest mode) only");
// For now, don't change mocktime if we're in the middle of validation, as