Simplify z_importkey by making rescan a string

Transparently handles older boolean values as well.
This commit is contained in:
Jack Grigg
2017-03-23 15:57:11 +13:00
parent a31ba7a0cb
commit b7e5b7d5ee
2 changed files with 20 additions and 11 deletions

View File

@@ -102,7 +102,7 @@ class Wallet1941RegressionTest (BitcoinTestFramework):
self.sync_all()
# Import the key on node 1, only scanning the last few blocks.
self.nodes[1].z_importkey(key, 'true', self.nodes[1].getblockchaininfo()['blocks'] - 100)
self.nodes[1].z_importkey(key, 'yes', self.nodes[1].getblockchaininfo()['blocks'] - 100)
# Confirm that the balance on node 1 is zero, as we have not
# rescanned over the older transactions
@@ -110,7 +110,7 @@ class Wallet1941RegressionTest (BitcoinTestFramework):
assert_equal(Decimal(resp), 0)
# Re-import the key on node 1, scanning from before the transaction.
self.nodes[1].z_importkey(key, 'true', self.nodes[1].getblockchaininfo()['blocks'] - 110)
self.nodes[1].z_importkey(key, 'yes', self.nodes[1].getblockchaininfo()['blocks'] - 110)
# Confirm that the balance on node 1 is valid now (node 1 must
# have rescanned)