Skip to content

Commit 96488e6

Browse files
author
MarcoFalke
committed
Merge #18263: rpc: change setmocktime check to use IsMockableChain
2455aa5 [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](bitcoin/bitcoin#18037 (comment)) in #18037 ACKs for top commit: MarcoFalke: ACK 2455aa5 🙇 jonatack: ACK 2455aa5 Tree-SHA512: 1d8c8b7ff0b3c1bcbf5755194969b6664fe05a35003375ad08d18e34bcefd2df4f64d0e60078a10bbef3c8f469a9b9d07db467089b55c14cf532304bc965bffc
2 parents a2a77ba + 2455aa5 commit 96488e6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/rpc/misc.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,9 @@ static UniValue setmocktime(const JSONRPCRequest& request)
351351
RPCExamples{""},
352352
}.Check(request);
353353

354-
if (!Params().MineBlocksOnDemand())
355-
throw std::runtime_error("setmocktime for regression testing (-regtest mode) only");
354+
if (!Params().IsMockableChain()) {
355+
throw std::runtime_error("setmocktime is for regression testing (-regtest mode) only");
356+
}
356357

357358
// For now, don't change mocktime if we're in the middle of validation, as
358359
// this could have an effect on mempool time-based eviction, as well as

0 commit comments

Comments
 (0)