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

Commit

Permalink
prevent crash on tumbler restart due to index_cache not including ext…
Browse files Browse the repository at this point in the history
…ra mix depths
  • Loading branch information
AdamISZ committed Oct 16, 2016
1 parent e1ca488 commit 502b6a8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions joinmarket/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ def read_wallet_file_data(self, filename, pwd=None):
sys.exit(0)
if 'index_cache' in walletdata:
self.index_cache = walletdata['index_cache']
if self.max_mix_depth > len(self.index_cache):
#This can happen e.g. in tumbler when we need more mixdepths
#than currently exist. Since we have no info for those extra
#depths, we must default to (0,0) (but sync should find used
#adddresses).
self.index_cache += [[0,0]] * (
self.max_mix_depth - len(self.index_cache))
decrypted = False
while not decrypted:
if pwd:
Expand Down

0 comments on commit 502b6a8

Please sign in to comment.