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

Commit

Permalink
fix bug in yg-pe oidtoorder
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamISZ committed Aug 10, 2016
1 parent 6cc78ff commit 0537a69
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions yg-pe.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,21 @@ def oid_to_order(self, cjorder, oid, amount):
#to the next mixdepth. Otherwise, we set "cjoutdepth" to the minimum.

nonmax_mix_balance = [m for m in filtered_mix_balance if m[0] != max_mix]
mixdepth = None
for m, bal in nonmax_mix_balance:
if m != max_mix:
mixdepth = m
break
if not mixdepth:
if not nonmax_mix_balance:
log.debug("Could not spend from a mixdepth which is not max")
mixdepth = max_mix
else:
mixdepth = nonmax_mix_balance[0][0]
log.debug('filling offer, mixdepth=' + str(mixdepth))

# mixdepth is the chosen depth we'll be spending from
# min_mixdepth is the one we want to send our cjout TO,
# to minimize chance of it becoming the largest, and reannouncing offer.
if mixdepth == min_mix:
cjoutmix = (mixdepth + 1) % self.wallet.max_mix_depth
#don't send cjout to max
if cjoutmix == max_mix:
cjoutmix = (cjoutmix + 1) % self.wallet.max_mix_depth
else:
cjoutmix = min_mix
cj_addr = self.wallet.get_internal_addr(cjoutmix)
Expand Down

0 comments on commit 0537a69

Please sign in to comment.