Skip to content

Commit

Permalink
zhtlc allow resync on app resume
Browse files Browse the repository at this point in the history
  • Loading branch information
naezith authored and CharlVS committed Oct 10, 2023
1 parent fedad06 commit 764461a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/blocs/coins_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ class CoinsBloc implements BlocBase {

/// Handle the coins user has picked for activation.
/// Also used for coin activations during the application startup.
Future<void> enableCoins(List<Coin> coins) async {
Future<void> enableCoins(List<Coin> coins, {initialization = false}) async {
await pauseUntil(() => !_coinsLock, maxMs: 3000);
_coinsLock = true;

Expand All @@ -483,6 +483,9 @@ class CoinsBloc implements BlocBase {
.map((c) => c.abbr)
.toList();

// Allow for resyncing of existing coins at app launch or resuming
_zCoinRepository.willInitialize = initialization;

await _zCoinRepository.addRequestedActivatedCoins(requestedZCoins);

// await _zCoinRepository.setRequestedActivatedCoins(requestedZCoins);
Expand Down
2 changes: 1 addition & 1 deletion lib/services/mm_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ class MMService {
await coinsBloc.activateCoinKickStart();
final active = await coinsBloc.electrumCoins();

await coinsBloc.enableCoins(active);
await coinsBloc.enableCoins(active, initialization: true);

for (int i = 0; i < 2; i++) {
await coinsBloc.retryActivatingSuspendedCoins();
Expand Down

0 comments on commit 764461a

Please sign in to comment.