mirror of
https://github.com/JoinMarket-Org/joinmarket-clientserver.git
synced 2026-08-13 12:33:40 +02:00
fix some max_mixdepth off-by-one errors
This commit is contained in:
parent
39e42762c7
commit
747c227762
2 changed files with 3 additions and 3 deletions
|
|
@ -179,7 +179,7 @@ class Taker(object):
|
|||
#if destination is flagged "INTERNAL", choose a destination
|
||||
#from the next mixdepth modulo the maxmixdepth
|
||||
if self.my_cj_addr == "INTERNAL":
|
||||
next_mixdepth = (self.mixdepth + 1) % self.wallet.max_mix_depth
|
||||
next_mixdepth = (self.mixdepth + 1) % (self.wallet.max_mixdepth + 1)
|
||||
jlog.info("Choosing a destination from mixdepth: " + str(next_mixdepth))
|
||||
self.my_cj_addr = self.wallet.get_internal_addr(next_mixdepth)
|
||||
jlog.info("Chose destination address: " + self.my_cj_addr)
|
||||
|
|
|
|||
|
|
@ -129,8 +129,8 @@ class YieldGeneratorBasic(YieldGenerator):
|
|||
jlog.info('filling offer, mixdepth=' + str(mixdepth))
|
||||
|
||||
# mixdepth is the chosen depth we'll be spending from
|
||||
cj_addr = self.wallet.get_internal_addr((mixdepth + 1) %
|
||||
self.wallet.max_mix_depth)
|
||||
cj_addr = self.wallet.get_internal_addr(
|
||||
(mixdepth + 1) % (self.wallet.max_mixdepth + 1))
|
||||
change_addr = self.wallet.get_internal_addr(mixdepth)
|
||||
self.import_new_addresses([cj_addr, change_addr])
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue