atomicDEX-API icon indicating copy to clipboard operation
atomicDEX-API copied to clipboard

return an error if transaction history futures initialization fails

Open shamardy opened this issue 1 year ago • 0 comments

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

shamardy avatar Oct 09 '23 14:10 shamardy