Bitcoin Forum
July 08, 2024, 03:43:00 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Missing blocks when parsing the blockchain  (Read 637 times)
szayat (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 1


View Profile
June 14, 2016, 08:53:27 PM
Merited by ABCbits (1)
 #1

Hey there.  I have been trying to solve this on my own, but I thought I would throw it out to a knowledgeable community.  I wrote/tweaked a simple blockchain parser in python, based mostly off of https://github.com/tenthirtyone/blocktools.  I am able to parse through everything find, but I noticed that there are gaps in my blocks when comparing against blockchain.info.  Case in point, when parsing the initial block (blk00000.dat), everything is going fine until the block with hash 00000000306d8ff2a054d739a88fea4d9fd453508571331ca944099ea77c3b0c.  I see it at depth 881 but blockchain.info shows it at depth 897.

The hash of the prior block in the file is:
00000000722571752a29b6e318a450d1b09181b51ca3ff498ba52d8dfcb82f19
Which corresponds to #880 on blockchain.info.  But the value in the block's previous hash field is:
00000000dabe35441efb615ad072e22ece58326cf0a43b990fc00aab808e8589
Which corresponds to #896.  So there are 16 missing blocks.  Where are they?

I see this in all the files that I have parsed to date, this is just the first example.  And I have tried a bunch of different parsers, and they all skip these blocks as well.  Am I missing something?  I haven't seen anything in my google search dealing with these skipped blocks.

Thanks for any help.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3444
Merit: 6748


Just writing some code


View Profile WWW
June 14, 2016, 10:37:24 PM
 #2

Bitcoin core doesn't necessarily receive blocks in order and it writes them to the disk in the order it receives them. This is probably the problem you are having.

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!