mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 03:49:22 +00:00
refactor maxConsecutiveFusionRoundsFailed->failed
This commit is contained in:
parent
4a619d68ad
commit
d5c4923031
2 changed files with 10 additions and 7 deletions
|
@ -109,7 +109,7 @@ class FusionProgressUIState extends ChangeNotifier {
|
|||
void incrementFusionRoundsCompleted() {
|
||||
_fusionRoundsCompleted++;
|
||||
_fusionRoundsFailed = 0; // Reset failed round count on success.
|
||||
_maxConsecutiveFusionRoundsFailed = false; // Reset failed flag on success.
|
||||
_failed = false; // Reset failed flag on success.
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
|
@ -129,11 +129,14 @@ class FusionProgressUIState extends ChangeNotifier {
|
|||
|
||||
/// A flag indicating that fusion has stopped because the maximum number of
|
||||
/// consecutive failed fusion rounds has been reached.
|
||||
bool _maxConsecutiveFusionRoundsFailed = false;
|
||||
bool get maxConsecutiveFusionRoundsFailed =>
|
||||
_maxConsecutiveFusionRoundsFailed;
|
||||
set maxConsecutiveFusionRoundsFailed(bool maxConsecutiveFusionRoundsFailed) {
|
||||
_maxConsecutiveFusionRoundsFailed = maxConsecutiveFusionRoundsFailed;
|
||||
///
|
||||
/// Set from the interface. I didn't want to have to configure
|
||||
///
|
||||
/// Used to be named maxConsecutiveFusionRoundsFailed.
|
||||
bool _failed = true;
|
||||
bool get failed => _failed;
|
||||
set failed(bool failed) {
|
||||
_failed = failed;
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -572,7 +572,7 @@ mixin FusionWalletInterface {
|
|||
// If we fail too many times in a row, stop trying.
|
||||
if (_failedFuseCount >= maxFailedFuseCount) {
|
||||
_stopRequested = true;
|
||||
_uiState?.maxConsecutiveFusionRoundsFailed = true;
|
||||
_uiState?.failed = true;
|
||||
}
|
||||
} finally {
|
||||
// Increment the number of successfully completed fusion rounds.
|
||||
|
|
Loading…
Reference in a new issue