Commit daa62da2 authored by dev0tion's avatar dev0tion

Fix 100 percent synced before chaintip equals last block synced height

parent d8ef3d25
......@@ -18,6 +18,7 @@ export class StatusBarComponent implements OnInit {
private lastBlockSyncedHeight: number;
private chainTip: number;
private connectedNodes: number = 0;
private percentSyncedNumber: number = 0;
private percentSynced: string;
constructor(private apiService: ApiService, private globalService: GlobalService) { }
......@@ -40,7 +41,13 @@ export class StatusBarComponent implements OnInit {
this.lastBlockSyncedHeight = generalWalletInfoResponse.lastBlockSyncedHeight;
this.chainTip = generalWalletInfoResponse.chainTip;
this.connectedNodes = generalWalletInfoResponse.connectedNodes;
this.percentSynced = ((this.lastBlockSyncedHeight / this.chainTip) * 100).toFixed(0);
this.percentSyncedNumber = ((this.lastBlockSyncedHeight / this.chainTip) * 100);
if (this.percentSyncedNumber.toFixed(0) === "100" && this.lastBlockSyncedHeight != this.chainTip) {
this.percentSyncedNumber = 99;
}
this.percentSynced = this.percentSyncedNumber.toFixed(0);
}
},
error => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment