Bitcoin Forum
April 20, 2024, 03:07:05 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to determine how far block download has progressed?  (Read 1094 times)
wumpus (OP)
Hero Member
*****
qt
Offline Offline

Activity: 812
Merit: 1022

No Maps for These Territories


View Profile
June 15, 2011, 08:29:35 PM
 #1

I'd like to show a progress bar on initial download on the block chain, or when the client was disconnected for a while and needs to catch up.

This would give the user a more useful indication than just a raw count.

There is nBestHeight (which can be queried with getblockcount/getblocknumber), and the IsInitialBlockDownload function, but those only take into account the downloaded blocks. Is there a way to find out how many blocks there are in total? (without querying a third party)


Bitcoin Core developer [PGP] Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
1713582425
Hero Member
*
Offline Offline

Posts: 1713582425

View Profile Personal Message (Offline)

Ignore
1713582425
Reply with quote  #2

1713582425
Report to moderator
1713582425
Hero Member
*
Offline Offline

Posts: 1713582425

View Profile Personal Message (Offline)

Ignore
1713582425
Reply with quote  #2

1713582425
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713582425
Hero Member
*
Offline Offline

Posts: 1713582425

View Profile Personal Message (Offline)

Ignore
1713582425
Reply with quote  #2

1713582425
Report to moderator
1713582425
Hero Member
*
Offline Offline

Posts: 1713582425

View Profile Personal Message (Offline)

Ignore
1713582425
Reply with quote  #2

1713582425
Report to moderator
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1024



View Profile
June 15, 2011, 11:24:55 PM
 #2

No.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5180
Merit: 12873


View Profile
June 16, 2011, 02:30:08 AM
 #3

The version messages exchanged between peers right after connecting contains the current block height. You could take the median of your peers' heights as a low-reliability number.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
wumpus (OP)
Hero Member
*****
qt
Offline Offline

Activity: 812
Merit: 1022

No Maps for These Territories


View Profile
June 16, 2011, 05:07:32 AM
 #4

The version messages exchanged between peers right after connecting contains the current block height. You could take the median of your peers' heights as a low-reliability number.
Thanks. Low-reliability is not an issue, as it is an indication for visual purposes.

Bitcoin Core developer [PGP] Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!