Fix getblocktemplate_proposals test by mining one block #5756

pull sdaftuar wants to merge 1 commits into bitcoin:master from sdaftuar:fix-getblocktemplate-proposals changing 1 files +1 −0
  1. sdaftuar commented at 5:05 PM on February 4, 2015: member

    This triggers the tested node to no longer be in initial download, allowing the call to getblocktemplate() to succeed.

  2. Fix getblocktemplate_proposals test by mining one block
    This triggers the tested node to no longer be in initial
    download, allowing the call to getblocktemplate() to succeed.
    1cb2a00cb8
  3. gavinandresen commented at 5:15 PM on February 4, 2015: contributor

    ACK.

  4. jonasschnelli commented at 7:14 PM on February 4, 2015: contributor

    ACK

  5. luke-jr commented at 9:09 PM on February 4, 2015: member

    This seems like it is merely working around a bug that should be fixed. Am I wrong?

  6. sdaftuar commented at 9:51 PM on February 4, 2015: member

    Well I'm not sure and I'd defer to you, but my thought was that:

    a) the getblocktemplate rpc call only successfully completes if IsInitialBlockDownload returns true, b) IsInitialBlockDownload is generally going to return false on startup of a bitcoind running in regtest mode, because it will be checking the time on the best block, which will either be the genesis block or the tip of the cached chain, and in either case likely to be more than 1 day old, c) mining a block with a current time stamp seems like a generally foolproof way in our regtest framework to get a node to think it's out of initial block download.

    If either a) or b) shouldn't be true, then I think that would call for a different fix than I've proposed here, but otherwise this seemed like a reasonable solution to prepare the testing environment to run the test.

  7. luke-jr commented at 9:58 PM on February 4, 2015: member

    (b) precludes (c) when/if we replace setgenerate with an external test script. I think (b) needs to change? Timestamp-based logic here shouldn't be necessary now that we have headers first, right?

  8. laanwj merged this on Feb 5, 2015
  9. laanwj closed this on Feb 5, 2015

  10. laanwj referenced this in commit 5d901d8ece on Feb 5, 2015
  11. luke-jr referenced this in commit d4e0b379d5 on Jan 8, 2016
  12. 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-14 12:16 UTC

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