aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_txn_doublespend.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-02-25 11:44:18 -0500
committerMarcoFalke <falke.marco@gmail.com>2019-02-25 11:44:21 -0500
commit8f470ecc534d49cb5f7045ea9564481acd3e2b4b (patch)
treea9995cf47daaf1180c6bef10932753222b328c9f /test/functional/wallet_txn_doublespend.py
parentb4fc5257b7dc106ff210d170397d4ce0e024f2c0 (diff)
parentfa2cdc9ac2672301591cafceb8ff230b95425ad0 (diff)
downloadbitcoin-8f470ecc534d49cb5f7045ea9564481acd3e2b4b.tar.xz
Merge #15419: qa: Always refresh cache to be out of ibd
fa2cdc9ac2 test: Simplify create_cache (MarcoFalke) fa25210d62 qa: Fix wallet_txn_doublespend issue (MarcoFalke) 1111aecbb5 qa: Always refresh stale cache to be out of ibd (MarcoFalke) fab0d85802 qa: Remove mocktime unless required (MarcoFalke) Pull request description: When starting a test, we are always in IBD because the timestamps on cached blocks are in the past. Usually, we solve that by generating a block at the beginning of the test. That is clumsy and might even lead to other problems such as #15360 and https://github.com/bitcoin/bitcoin/issues/14446#issuecomment-461926598 So fix that by getting rid of mocktime and always refreshing the last block of the cache when starting the test framework. Should fix #14446 Tree-SHA512: 6af09800f9c86131349a103af617a54551f5f3f3260d38e14e3f30fdd3d91a0feb0100c56cbb12eae4aeac5571ae4b530b16345cbb831d2670237b53351a22c1
Diffstat (limited to 'test/functional/wallet_txn_doublespend.py')
-rwxr-xr-xtest/functional/wallet_txn_doublespend.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/wallet_txn_doublespend.py b/test/functional/wallet_txn_doublespend.py
index f114d5ab68..9050e21247 100755
--- a/test/functional/wallet_txn_doublespend.py
+++ b/test/functional/wallet_txn_doublespend.py
@@ -34,6 +34,14 @@ class TxnMallTest(BitcoinTestFramework):
def run_test(self):
# All nodes should start with 1,250 BTC:
starting_balance = 1250
+
+ # All nodes should be out of IBD.
+ # If the nodes are not all out of IBD, that can interfere with
+ # blockchain sync later in the test when nodes are connected, due to
+ # timing issues.
+ for n in self.nodes:
+ assert n.getblockchaininfo()["initialblockdownload"] == False
+
for i in range(4):
assert_equal(self.nodes[i].getbalance(), starting_balance)
self.nodes[i].getnewaddress("") # bug workaround, coins generated assigned to first getnewaddress!