Fix nonsensical bitcoin-cli -norpcwallet behavior

Treat specifying -norpcwallet the same as not specifying any -rpcwallet option,
instead of treating it like -rpcwallet=0 with 0 as the wallet name.

This restores previous behavior before 743077544b
from https://github.com/bitcoin/bitcoin/pull/18594, which inadvertently changed
it.
This commit is contained in:
Ryan Ofsky
2019-12-19 18:00:04 -05:00
parent 6e8e7f433f
commit 5544a19f86
2 changed files with 14 additions and 6 deletions

View File

@@ -279,6 +279,10 @@ class TestBitcoinCli(BitcoinTestFramework):
assert_equal(cli_get_info['Wallet'], wallets[1])
assert_equal(Decimal(cli_get_info['Balance']), amounts[1])
self.log.info("Test -getinfo -norpcwallet returns the same as -getinfo")
# Previously there was a bug where -norpcwallet was treated like -rpcwallet=0
assert_equal(self.nodes[0].cli('-getinfo', "-norpcwallet").send_cli(), cli_get_info_string)
self.log.info("Test -getinfo with -rpcwallet=remaining-non-default-wallet returns only its balance")
cli_get_info_string = self.nodes[0].cli('-getinfo', rpcwallet2).send_cli()
cli_get_info = cli_get_info_string_to_dict(cli_get_info_string)