mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
Merge #18263: rpc: change setmocktime check to use IsMockableChain
2455aa5d7f
[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: ACK2455aa5d7f
🙇 jonatack: ACK2455aa5d7f
Tree-SHA512: 1d8c8b7ff0b3c1bcbf5755194969b6664fe05a35003375ad08d18e34bcefd2df4f64d0e60078a10bbef3c8f469a9b9d07db467089b55c14cf532304bc965bffc
This commit is contained in:
commit
96488e6784
1 changed files with 3 additions and 2 deletions
|
@ -351,8 +351,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
|
||||
|
|
Loading…
Reference in a new issue