Allow getblocktemlate for not connected regtest node #9116

pull ondrejsika wants to merge 1 commits into bitcoin:master from ondrejsika:master changing 1 files +2 −1
  1. ondrejsika commented at 12:21 PM on November 9, 2016: none

    No description provided.

  2. Allow getblocktemlate for not connected regtest node 849f6ea343
  3. fanquake added the label RPC/REST/ZMQ on Nov 9, 2016
  4. laanwj commented at 4:05 PM on November 9, 2016: member

    This has come up before in a discussion recently.

    However, instead of a special-case for regtest I think we should add a command line option to ignore the getblocktemplate pre-checks, both this one and the IsInitialBlockDownload - this makes it more general, and avoids switching on the name of the network, which is considered a bad thing.

  5. paveljanik commented at 8:41 AM on November 10, 2016: contributor

    Shouldn't regtest be "always connected"?

  6. MarcoFalke commented at 9:54 AM on November 10, 2016: member

    Shouldn't regtest be "always connected"?

    Probably not, it depends on your use case. So I agree with @laanwj and we should keep the special cases of regtest to a minimum.

  7. in src/rpc/mining.cpp:None in 849f6ea343
     464 | @@ -465,7 +465,8 @@ UniValue getblocktemplate(const JSONRPCRequest& request)
     465 |      if(!g_connman)
     466 |          throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled");
     467 |  
     468 | -    if (g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL) == 0)
     469 | +    // Allow getblocktemlate for not connected regtest node
     470 | +    if (Params().NetworkIDString() != "regtest" && g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL) == 0)
    


    luke-jr commented at 6:19 AM on December 2, 2016:

    Do the regtest comparison second so it can't incur any penalty on normal operation.

  8. fanquake commented at 1:34 PM on January 12, 2017: member

    Closing this due to inactivity. @ondrejsika if this is something your still working on/would like merged could you address the feedback here.

  9. fanquake closed this on Jan 12, 2017

  10. MarcoFalke locked this on Sep 8, 2021

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:15 UTC

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