tdex-network / tdex-daemon

Go implementation of the TDEX Beta Daemon
https://tdex.network
MIT License
11 stars 13 forks source link

Restore: Do return error and block execution if one market has a problem #553

Closed tiero closed 1 year ago

tiero commented 2 years ago

It can happen during account restoration to get an error like

addresses discovery PROCESSING
addresses discovery DONE
restore account 8 PROCESSING
restore account 8 DONE
restore account 0 PROCESSING
restore account 0 DONE
restore account 5 PROCESSING
restore account 5 DONE
restore account 6 PROCESSING
restore account 6 DONE
restore account 7 PROCESSING
restore account 7 DONE
[tdex] rpc error: code = Unknown desc = unable to restore market: too many assets. This means among the deposited funds there are unspents with asset different from the market pair. They must be withdrawn to open the market

This stops execution and the proper initialization status update, would be best to keep going and complete the initialization status to let user handle situation eventually.

Maybe would be best to introduce a command for restoring a specific account index, even after initial initialization has been done?