aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_create_tx.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_create_tx.py
parentb4fc5257b7dc106ff210d170397d4ce0e024f2c0 (diff)
parentfa2cdc9ac2672301591cafceb8ff230b95425ad0 (diff)
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_create_tx.py')
-rwxr-xr-xtest/functional/wallet_create_tx.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/functional/wallet_create_tx.py b/test/functional/wallet_create_tx.py
index 27dc0fb279..7b749235e2 100755
--- a/test/functional/wallet_create_tx.py
+++ b/test/functional/wallet_create_tx.py
@@ -7,17 +7,25 @@ from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
)
+from test_framework.blocktools import (
+ TIME_GENESIS_BLOCK,
+)
class CreateTxWalletTest(BitcoinTestFramework):
def set_test_params(self):
- self.setup_clean_chain = False
+ self.setup_clean_chain = True
self.num_nodes = 1
def skip_test_if_missing_module(self):
self.skip_if_no_wallet()
def run_test(self):
+ self.log.info('Create some old blocks')
+ self.nodes[0].setmocktime(TIME_GENESIS_BLOCK)
+ self.nodes[0].generate(200)
+ self.nodes[0].setmocktime(0)
+
self.log.info('Check that we have some (old) blocks and that anti-fee-sniping is disabled')
assert_equal(self.nodes[0].getblockchaininfo()['blocks'], 200)
txid = self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), 1)