mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Merge #18263: rpc: change setmocktime check to use IsMockableChain
2455aa5d7f54befeade05795ed8f5dd89d01042a [rpc] changed MineBlocksOnDemand to IsMockableChain (Gloria Zhao) Pull request description: Change: Update the if statement in `setmocktime` to use `IsMockableChain` chainparams function (aka `m_is_mockable_chain`) instead of `MineBlocksOnDemand` Rationale: It's a more appropriate check for whether or not chain is in RegTest, as [discussed](https://github.com/bitcoin/bitcoin/pull/18037#discussion_r376509388) in #18037 ACKs for top commit: MarcoFalke: ACK 2455aa5d7f54befeade05795ed8f5dd89d01042a 🙇 jonatack: ACK 2455aa5d7f54befeade05795ed8f5dd89d01042a Tree-SHA512: 1d8c8b7ff0b3c1bcbf5755194969b6664fe05a35003375ad08d18e34bcefd2df4f64d0e60078a10bbef3c8f469a9b9d07db467089b55c14cf532304bc965bffc
This commit is contained in:
parent
70ed624cea
commit
5747337191
@ -507,8 +507,9 @@ static UniValue setmocktime(const JSONRPCRequest& request)
|
|||||||
RPCExamples{""},
|
RPCExamples{""},
|
||||||
}.Check(request);
|
}.Check(request);
|
||||||
|
|
||||||
if (!Params().MineBlocksOnDemand())
|
if (!Params().IsMockableChain()) {
|
||||||
throw std::runtime_error("setmocktime for regression testing (-regtest mode) only");
|
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
|
// 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
|
// this could have an effect on mempool time-based eviction, as well as
|
||||||
|
Loading…
Reference in New Issue
Block a user