rpc: change setmocktime check to use IsMockableChain #18263

pull glozow wants to merge 1 commits into bitcoin:master from glozow:rpc-setmocktime-check changing 1 files +3 −2
  1. glozow commented at 10:25 PM on March 4, 2020: member

    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 in #18037

  2. glozow renamed this:
    rpc change setmocktime check to use IsMockableChain
    [WIP] rpc change setmocktime check to use IsMockableChain
    on Mar 4, 2020
  3. glozow renamed this:
    [WIP] rpc change setmocktime check to use IsMockableChain
    [WIP] [rpc] change setmocktime check to use IsMockableChain
    on Mar 4, 2020
  4. fanquake added the label RPC/REST/ZMQ on Mar 4, 2020
  5. glozow renamed this:
    [WIP] [rpc] change setmocktime check to use IsMockableChain
    [WIP] rpc: change setmocktime check to use IsMockableChain
    on Mar 4, 2020
  6. glozow renamed this:
    [WIP] rpc: change setmocktime check to use IsMockableChain
    rpc: change setmocktime check to use IsMockableChain
    on Mar 4, 2020
  7. amitiuttarwar commented at 11:17 PM on March 4, 2020: contributor

    ACK 4264e97b42e87ff1e103eb1f919cff4c0f56c4fe. Thanks for this follow up :)

  8. glozow marked this as ready for review on Mar 4, 2020
  9. in src/rpc/misc.cpp:348 in 4264e97b42 outdated
     344 | @@ -345,7 +345,7 @@ static UniValue setmocktime(const JSONRPCRequest& request)
     345 |                  RPCExamples{""},
     346 |              }.Check(request);
     347 |  
     348 | -    if (!Params().MineBlocksOnDemand())
     349 | +    if (!Params().IsMockableChain())
    


    MarcoFalke commented at 1:45 PM on March 5, 2020:
        if (!Params().IsMockableChain()) {
    

    Might as well fix up with the new style (opening and closing {}). Not a blocking nit.


    glozow commented at 5:57 PM on March 5, 2020:

    done e8600d9

  10. MarcoFalke approved
  11. MarcoFalke commented at 1:45 PM on March 5, 2020: member

    ACK

  12. in src/rpc/misc.cpp:349 in 4264e97b42 outdated
     344 | @@ -345,7 +345,7 @@ static UniValue setmocktime(const JSONRPCRequest& request)
     345 |                  RPCExamples{""},
     346 |              }.Check(request);
     347 |  
     348 | -    if (!Params().MineBlocksOnDemand())
     349 | +    if (!Params().IsMockableChain())
     350 |          throw std::runtime_error("setmocktime for regression testing (-regtest mode) only");
    


    jonatack commented at 4:03 PM on March 5, 2020:

    Non-blocking nit: if you retouch this to add the opening and closing curly braces, could you also add the missing "is" in the error message? Like in https://github.com/bitcoin/bitcoin/pull/18037/files#diff-ad6efdc354b57bd1fa29fc3abb6e2872R383. Happy to re-ACK.


    glozow commented at 5:57 PM on March 5, 2020:

    done e8600d9

  13. jonatack commented at 4:04 PM on March 5, 2020: member

    ACK 4264e97b42e87ff1e103eb1f919cff4c0f56c4fe modulo nits

  14. promag commented at 4:30 PM on March 5, 2020: member

    ACK 4264e97b42e87ff1e103eb1f919cff4c0f56c4fe.

  15. MarcoFalke commented at 6:05 PM on March 5, 2020: member
  16. [rpc] changed MineBlocksOnDemand to IsMockableChain 2455aa5d7f
  17. glozow force-pushed on Mar 5, 2020
  18. glozow requested review from jonatack on Mar 5, 2020
  19. jonatack commented at 6:32 PM on March 5, 2020: member

    ACK 2455aa5d7f54befeade05795ed8f5dd89d01042a

    Thanks @gzhao408!

  20. MarcoFalke commented at 6:39 PM on March 5, 2020: member

    ACK 2455aa5d7f54befeade05795ed8f5dd89d01042a 🙇

    <details><summary>Show signature and timestamp</summary>

    Signature:

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA512
    
    ACK 2455aa5d7f54befeade05795ed8f5dd89d01042a 🙇
    -----BEGIN PGP SIGNATURE-----
    
    iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
    pUhgEwwAgu4dpEDkq9fI71/VCr2Bo103qv80aKgiOGv1bOdUIObAQgD98Y39o8b2
    lEppR8ivMCET6XZjp5AC39NRMA2YpvxAPNA9CyCIW8IdWWC1AZlbSOgXQnj4e1Ge
    Rl1P3wt9GN4q8R9BiTNizD9njQVTThpM2tr0qR5eL1xMtEgbeDLzHUwUhddfXtns
    g6V+6GEh5WUbtPKn7cOk8DNQhDTZrBVSugc1/8gUfZhm342cf4ztmeZHHbqyHdz1
    hBdPZP/uY1d0zwajANpWEI7vXrC0P4mrbFdRW88ejOZn8nZdAREpcarWBA3+Q7Vt
    T0XdTex/W/jyN8iVnXd5uQzWGa/1s8evPb67ph8HSKUGnGSZIfc+pVY2LqCtpaYN
    cl/m42X1//XdeMAtq/rGVeg9/MFMqoeAUxS+9MoLaFaG1Hw/E6udfdOJ5iENYjMX
    11sNgwL74TIvo0F+ws9Q2lxrca2O86AlBMjJ/AZaYRjy2KkdO5EpoWU2vp2j+ReR
    d5F5+cpC
    =nHWU
    -----END PGP SIGNATURE-----
    

    Timestamp of file with hash 1b061df7687ff438c7b5c195a12c2d0b089b1ff6cc7d010071513fbb19807002 -

    </details>

  21. MarcoFalke merged this on Mar 5, 2020
  22. MarcoFalke closed this on Mar 5, 2020

  23. glozow deleted the branch on May 25, 2020
  24. Fabcien referenced this in commit aa3561df33 on Jan 5, 2021
  25. PastaPastaPasta referenced this in commit 023cda03c2 on Jun 27, 2021
  26. PastaPastaPasta referenced this in commit 653269009c on Jun 28, 2021
  27. PastaPastaPasta referenced this in commit 98b287fb52 on Jun 29, 2021
  28. MarcoFalke locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me