Author

Topic: How to determine how far block download has progressed? (Read 1096 times)

hero member
Activity: 812
Merit: 1022
No Maps for These Territories
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.
administrator
Activity: 5222
Merit: 13032
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.
kjj
legendary
Activity: 1302
Merit: 1026
hero member
Activity: 812
Merit: 1022
No Maps for These Territories
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)

Jump to: