atomicDEX-API
atomicDEX-API copied to clipboard
return an error if transaction history futures initialization fails
As explained by @onur-ozkan
Just checked the source code, activation and deactivation operations are relying on the CoinsContext Mutex.
e.g.,:
activation requested -> TendermintCoin initialized -> spawning tx/history / balance streaming futures -> locked(no parallel execution allowed here) coins context and added TendermintCoin in there -> success result
However, spawned futures can end up unexpectedly because there is no guarantee that they will be successfully executed/initialized before we add their coin into CoinsContext. This means that a spawned future could encounter errors or panics after we add the coin to the context and return a success result.
ref. https://github.com/KomodoPlatform/komodo-defi-framework/pull/1978#discussion_r1348603161, https://github.com/KomodoPlatform/komodo-defi-framework/pull/1978#issuecomment-1752787020, https://github.com/KomodoPlatform/komodo-defi-framework/pull/1978#issuecomment-1752805348