Bitcoin Forum
August 22, 2017, 01:46:03 PM *
News: Latest stable version of Bitcoin Core: 0.14.2  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: How to determine how far block download has progressed?  (Read 978 times)
wumpus
Hero Member
*****
qt
Offline Offline

Activity: 798

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.
1503409563
Hero Member
*
Offline Offline

Posts: 1503409563

View Profile Personal Message (Offline)

Ignore
1503409563
Reply with quote  #2

1503409563
Report to moderator
1503409563
Hero Member
*
Offline Offline

Posts: 1503409563

View Profile Personal Message (Offline)

Ignore
1503409563
Reply with quote  #2

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

Posts: 1503409563

View Profile Personal Message (Offline)

Ignore
1503409563
Reply with quote  #2

1503409563
Report to moderator
kjj
Legendary
*
Offline Offline

Activity: 1302



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

No.

p2pcoin: a USB/CD/PXE p2pool miner - 1N8ZXx2cuMzqBYSK72X4DAy1UdDbZQNPLf - todo
I routinely ignore posters with paid advertising in their sigs.  You should too.
theymos
Administrator
Legendary
*
expert
Offline Offline

Activity: 2758


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
Hero Member
*****
qt
Offline Offline

Activity: 798

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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!