Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions DashWallet/DWRootViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,10 @@ -(void)setObserversWithDeviceIsJailbroken:(BOOL)jailbroken {
[self showErrorBar];
}];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(chainPeerManagerNewBlockNotification)
name:DSChainPeerManagerNewBlockNotification
object:nil];
}

- (void)viewWillAppear:(BOOL)animated
Expand Down Expand Up @@ -950,6 +954,22 @@ - (void)setProgressTo:(NSNumber *)n
self.progress.progress = n.floatValue;
}

- (void)chainPeerManagerNewBlockNotification
{
double progress = [DWEnvironment sharedInstance].currentChainPeerManager.syncProgress;
if (progress > DBL_EPSILON && progress + DBL_EPSILON < 1.0) { // not done syncing
if (self.progress.hidden) {
[self startActivityWithTimeout:0];
}
else {
[self updateProgress];
}
}
else {
[self stopActivityWithSuccess:YES];
}
}

- (void)updateProgress
{
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(updateProgress) object:nil];
Expand Down