Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Fix #588 Wallet list index out of range error #589

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions joinmarket/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def get_balance_by_mixdepth(self):
class Wallet(AbstractWallet):
def __init__(self,
seedarg,
max_mix_depth=2,
max_mix_depth=-1,
gaplimit=6,
extend_mixdepth=False,
storepassword=False):
Expand All @@ -127,8 +127,10 @@ def __init__(self,
self.spent_utxos = []
self.imported_privkeys = {}
self.seed = self.read_wallet_file_data(seedarg)
if extend_mixdepth and len(self.index_cache) > max_mix_depth:
self.max_mix_depth = len(self.index_cache)
if len(self.index_cache) > max_mix_depth:
if extend_mixdepth or max_mix_depth == -1:
log.debug('Detected ' + str(len(self.index_cache)) + ' mixdepths in wallet-file.')
self.max_mix_depth = len(self.index_cache)
self.gaplimit = gaplimit
master = btc.bip32_master_key(self.seed, (btc.MAINNET_PRIVATE if
get_network() == 'mainnet' else btc.TESTNET_PRIVATE))
Expand Down
2 changes: 1 addition & 1 deletion wallet-tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
maxmixdepth_configured = True
if not options.maxmixdepth:
maxmixdepth_configured = False
options.maxmixdepth = 5
options.maxmixdepth = -1

noseed_methods = ['generate', 'recover', 'listwallets']
methods = ['display', 'displayall', 'summary', 'showseed', 'importprivkey',
Expand Down