joinmarket-clientserver icon indicating copy to clipboard operation
joinmarket-clientserver copied to clipboard

Tumbler error afret --restart: No confirmed coins in the selected mixdepth(s). Quitting

Open OvoNemaSmisla opened this issue 2 years ago • 3 comments

Hi,

After running the tumbler for a few hours, it showed a message through CLI that I have one utxo which has less then 5 confirmations and that Taker is stopping: [INFO] Taker not continuing after receipt of orderbook

I've restarted the tumbler with the initial command with --restart after the utxo got 7 confirmations, but got another error message:

Traceback (most recent call last):
  File "tumbler.py", line 193, in <module>
    main()
  File "tumbler.py", line 143, in main
    raise ValueError("No confirmed coins in the selected mixdepth(s). Quitting")
ValueError: No confirmed coins in the selected mixdepth(s). Quitting

I've analyzed tumbler.py code and I believe the problem is the loop in line 140:

for i in range(options['mixdepthsrc'], max_mix_to_tumble):
    total_tumble_amount += wallet_service.get_balance_by_mixdepth()[i]
    if total_tumble_amount == 0:
        raise ValueError("No confirmed coins in the selected mixdepth(s). Quitting")

options['mixdepthsrc'] and max_mix_to_tumble are 0 and 4 (loaded from the wallet), so the loop is going through the mix depths to calculate total_tumble_amount by adding amounts from each mix depth.

The problem is if you restarted the tumbler with --restart, there is a chance that one of the mix depths is empty and this will trigger the error. In my case mix depth 0 was empty, so the loop only executed once since if total_tumble_amount == 0 was true.

Imo, there are 2 ways to fix this:

  1. Check if we are in --restart mode to start the loop from the first mix depth in the schedule:
if res:
    min_mix_depth = schedule[0][0]
else:
    min_mix_depth = options['mixdepthsrc']
for i in range(min_mix_depth, max_mix_to_tumble):
  1. Take the If statement out of the Loop:
for i in range(options['mixdepthsrc'], max_mix_to_tumble):
    total_tumble_amount += wallet_service.get_balance_by_mixdepth()[i]
if total_tumble_amount == 0:
    raise ValueError("No confirmed coins in the selected mixdepth(s). Quitting")

I've tested the second way and the tumbler finished successfully.

Let me know if there is any other information I can provide in order to fix this.

OvoNemaSmisla avatar Jul 31 '21 11:07 OvoNemaSmisla

I have the same issue.

Steps to reproduce: 1.) empty mixdepth 0 2.) create a TUMBLE.schedule starting from depth 1 3.) run tumbler.py --restart

It will fail.

tschaboo avatar Sep 25 '21 20:09 tschaboo

I remember this issue being reported a couple of times last year, but I don't remember the status. Did anyone look further into it?

AdamISZ avatar Jun 02 '22 15:06 AdamISZ

Steps to reproduce: 1.) empty mixdepth 0 2.) create a TUMBLE.schedule starting from depth 1 3.) run tumbler.py --restart

It will fail.

If you add the flag -m 1 to run tumbler.py -m 1 --restart, there will be no error.

generally speaking

as a workaround, one can use the flag -m [startingmixdepth accodring to TUMBLER.schedule]. This is not very user friendly, but works for now.

expected behavior tumbler.py recognizes the first line of the schedule file as starting mixdepth and doesn't need the -m flag to run the schedule file properly.

alaznem avatar Jul 02 '22 22:07 alaznem

This should be fixed, or more correctly, now irrelevant, after the change in version 0.9.7 to a 'cyclic' fixed mixdepth wallet tumbler algo.

AdamISZ avatar Sep 11 '22 11:09 AdamISZ