aboutsummaryrefslogtreecommitdiff
path: root/test/functional/wallet_backup.py
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2020-10-19 08:24:27 -0400
committerRussell Yanofsky <russ@yanofsky.org>2020-10-21 08:48:43 -0400
commit01476a88a6095fd3af71cb9bf1eadef920a1197b (patch)
tree7a4770657da954423232d5ba82350ff696f81db4 /test/functional/wallet_backup.py
parentb46f37ba5ec4fbd2e4c82343fc4f353d7f34837a (diff)
downloadbitcoin-01476a88a6095fd3af71cb9bf1eadef920a1197b.tar.xz
wallet: Make -wallet setting not create wallets
This changes -wallet setting to only load existing wallets, not create new ones. - Fixes settings.json corner cases reported by sjors & promag: https://github.com/bitcoin-core/gui/issues/95, https://github.com/bitcoin/bitcoin/pull/19754#issuecomment-685858578, https://github.com/bitcoin/bitcoin/pull/19754#issuecomment-685858578 - Prevents accidental creation of wallets reported most recently by jb55 http://www.erisian.com.au/bitcoin-core-dev/log-2020-09-14.html#l-355 - Simplifies behavior after #15454. #15454 took the big step of disabling creation of the default wallet. This PR extends it to avoid creating other wallets as well. With this change, new wallets just aren't created on startup, instead of sometimes being created, sometimes not. #15454 release notes are updated here and are simpler. This change should be targeted for 0.21.0. It's a bug fix and simplifies behavior of the #15937 / #19754 / #15454 features added in 0.21.0.
Diffstat (limited to 'test/functional/wallet_backup.py')
-rwxr-xr-xtest/functional/wallet_backup.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/test/functional/wallet_backup.py b/test/functional/wallet_backup.py
index c7bd2ea02b..f34c1345e0 100755
--- a/test/functional/wallet_backup.py
+++ b/test/functional/wallet_backup.py
@@ -91,10 +91,10 @@ class WalletBackupTest(BitcoinTestFramework):
self.sync_blocks()
# As above, this mirrors the original bash test.
- def start_three(self):
- self.start_node(0)
- self.start_node(1)
- self.start_node(2)
+ def start_three(self, args=()):
+ self.start_node(0, self.extra_args[0] + list(args))
+ self.start_node(1, self.extra_args[1] + list(args))
+ self.start_node(2, self.extra_args[2] + list(args))
self.connect_nodes(0, 3)
self.connect_nodes(1, 3)
self.connect_nodes(2, 3)
@@ -110,6 +110,11 @@ class WalletBackupTest(BitcoinTestFramework):
os.remove(os.path.join(self.nodes[1].datadir, self.chain, 'wallets', self.default_wallet_name, self.wallet_data_filename))
os.remove(os.path.join(self.nodes[2].datadir, self.chain, 'wallets', self.default_wallet_name, self.wallet_data_filename))
+ def init_three(self):
+ self.init_wallet(0)
+ self.init_wallet(1)
+ self.init_wallet(2)
+
def run_test(self):
self.log.info("Generating initial blockchain")
self.nodes[0].generate(1)
@@ -193,7 +198,8 @@ class WalletBackupTest(BitcoinTestFramework):
shutil.rmtree(os.path.join(self.nodes[2].datadir, self.chain, 'blocks'))
shutil.rmtree(os.path.join(self.nodes[2].datadir, self.chain, 'chainstate'))
- self.start_three()
+ self.start_three(["-nowallet"])
+ self.init_three()
assert_equal(self.nodes[0].getbalance(), 0)
assert_equal(self.nodes[1].getbalance(), 0)