This triggers the tested node to no longer be in initial download, allowing the call to getblocktemplate() to succeed.
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-
sdaftuar commented at 5:05 PM on February 4, 2015: member
-
1cb2a00cb8
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.
-
gavinandresen commented at 5:15 PM on February 4, 2015: contributor
ACK.
-
jonasschnelli commented at 7:14 PM on February 4, 2015: contributor
ACK
-
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?
-
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.
-
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?
- laanwj merged this on Feb 5, 2015
- laanwj closed this on Feb 5, 2015
- laanwj referenced this in commit 5d901d8ece on Feb 5, 2015
- luke-jr referenced this in commit d4e0b379d5 on Jan 8, 2016
- MarcoFalke locked this on Sep 8, 2021