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

Commit

Permalink
simple implementation of starting from first non-empty level in joinm…
Browse files Browse the repository at this point in the history
…arket wallet for issue #260

fixed sorting of list of levels properly

update options.mixdepthsrc instead of having new variable
  • Loading branch information
Dan Weatherill committed Oct 8, 2015
1 parent d686647 commit b25cb65
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tumbler.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,20 @@ def main():
wallet = Wallet(wallet_file, max_mix_depth = options.mixdepthsrc + options.mixdepthcount)
common.bc_interface.sync_wallet(wallet)

#check if there are actually any coins at the mixdepthsrc level
#if not, allow user to start at minimum used level
used_depths = [k for k,v in wallet.get_utxos_by_mixdepth().iteritems() if v != {}]
if options.mixdepthsrc not in used_depths:
ret = raw_input("no coins in chosen src level. Use lowest possible level? (y/n):")
if ret[0] !='y':
return
options.mixdepthsrc = sorted(used_depths.keys())[0]
print "starting with depth: " + str(options.mixdepthsrc)
wallet = Wallet(wallet_file,max_mix_depth = options.mixdepthsrc + options.mixdepthcount)
common.bc_interface.sync_wallet(wallet)



common.nickname = random_nick()
debug('starting tumbler')
irc = IRCMessageChannel(common.nickname)
Expand Down

0 comments on commit b25cb65

Please sign in to comment.