diff --git a/jmclient/jmclient/blockchaininterface.py b/jmclient/jmclient/blockchaininterface.py index 7a84760..51f14a9 100644 --- a/jmclient/jmclient/blockchaininterface.py +++ b/jmclient/jmclient/blockchaininterface.py @@ -539,6 +539,8 @@ class BlockrInterface(BlockchainInterface): #pragma: no cover # sets Wallet internal indexes to be at the next unused address for mix_depth in range(wallet.max_mix_depth): for forchange in [0, 1]: + #must reset at the start so as to search forward from the beginning + wallet.index[mix_depth][forchange] = 0 unused_addr_count = 0 last_used_addr = '' while (unused_addr_count < wallet.gaplimit or diff --git a/jmclient/jmclient/taker.py b/jmclient/jmclient/taker.py index d123bcd..61e275a 100644 --- a/jmclient/jmclient/taker.py +++ b/jmclient/jmclient/taker.py @@ -621,4 +621,5 @@ class Taker(object): jlog.debug("Confirmed callback in taker, confs: " + str(confirmations)) fromtx=False if self.schedule_index + 1 == len(self.schedule) else True waittime = self.schedule[self.schedule_index][4] - self.on_finished_callback(True, fromtx=fromtx, waittime=waittime) + self.on_finished_callback(True, fromtx=fromtx, waittime=waittime, + txdetails=(txd, txid)) diff --git a/scripts/sendpayment.py b/scripts/sendpayment.py index 01e92cc..a295e40 100644 --- a/scripts/sendpayment.py +++ b/scripts/sendpayment.py @@ -192,10 +192,12 @@ def main(): return False return True - def taker_finished(res, fromtx=False, waittime=0.0): + def taker_finished(res, fromtx=False, waittime=0.0, txdetails=None): if fromtx: if res: - sync_wallet(wallet, fast=options.fastsync) + txd, txid = txdetails + taker.wallet.remove_old_utxos(txd) + taker.wallet.add_new_utxos(txd, txid) reactor.callLater(waittime*60, clientfactory.getClient().clientStart) else: diff --git a/scripts/tumbler.py b/scripts/tumbler.py index fca4e41..b7df66d 100644 --- a/scripts/tumbler.py +++ b/scripts/tumbler.py @@ -100,7 +100,7 @@ def main(): def filter_orders_callback(orders_fees, cjamount): return True - def taker_finished(res, fromtx=False, waittime=0.0): + def taker_finished(res, fromtx=False, waittime=0.0, txdetails=None): """on_finished_callback for tumbler """ def unconf_update(): @@ -146,8 +146,9 @@ def main(): waiting_message = "Waiting for: " + str(waittime) + " minutes." tumble_log.info(waiting_message) log.info(waiting_message) - - sync_wallet(wallet, fast=options['fastsync']) + txd, txid = txdetails + taker.wallet.remove_old_utxos(txd) + taker.wallet.add_new_utxos(txd, txid) reactor.callLater(waittime*60, clientfactory.getClient().clientStart) else: