[rpc] changed MineBlocksOnDemand to IsMockableChain

This commit is contained in:
Gloria Zhao 2020-03-04 14:01:31 -08:00
parent 54a7ef612a
commit 2455aa5d7f
No known key found for this signature in database
GPG key ID: DF504BC87577F402

View file

@ -345,8 +345,9 @@ static UniValue setmocktime(const JSONRPCRequest& request)
RPCExamples{""},
}.Check(request);
if (!Params().MineBlocksOnDemand())
throw std::runtime_error("setmocktime for regression testing (-regtest mode) only");
if (!Params().IsMockableChain()) {
throw std::runtime_error("setmocktime is for regression testing (-regtest mode) only");
}
// For now, don't change mocktime if we're in the middle of validation, as
// this could have an effect on mempool time-based eviction, as well as