Skip to content

Commit

Permalink
clients/bitwindow: add verification height
Browse files Browse the repository at this point in the history
  • Loading branch information
octobocto committed Dec 3, 2024
1 parent 555bf21 commit e406681
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions clients/bitwindow/lib/pages/root_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,18 @@ class _StatusBarState extends State<StatusBar> {
child: SailText.primary12('Last block: ${_getTimeSinceLastBlock()}'),
),
const DividerDot(),
if (blockchainProvider.blockchainInfo.initialBlockDownload &&
blockchainProvider.blockchainInfo.blocks != blockchainProvider.blockchainInfo.headers)
Tooltip(
message:
'Current height: ${blockchainProvider.blockchainInfo.blocks}\nHeader height: ${blockchainProvider.blockchainInfo.headers}',
child: SailText.primary12(
'Downloading blocks (${blockchainProvider.verificationProgress}%)',
),
),
if (blockchainProvider.blockchainInfo.initialBlockDownload &&
blockchainProvider.blockchainInfo.blocks != blockchainProvider.blockchainInfo.headers)
const DividerDot(),
SailText.primary12(
'${formatWithThousandSpacers(blockchainProvider.blockchainInfo.blocks)} blocks',
),
Expand Down
1 change: 1 addition & 0 deletions clients/bitwindow/lib/providers/blockchain_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class BlockchainProvider extends ChangeNotifier {

// computed field go here
Timestamp? get lastBlockAt => recentBlocks.isNotEmpty ? recentBlocks.first.blockTime : null;
String get verificationProgress => ((blockchainInfo.blocks / blockchainInfo.headers) * 100).toStringAsFixed(2);

bool _isFetching = false;
Timer? _fetchTimer;
Expand Down

0 comments on commit e406681

Please sign in to comment.