Bitcoin Forum
May 17, 2024, 12:38:58 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: difference between blocksize and inconsistent hash record.  (Read 680 times)
coldguy (OP)
Member
**
Offline Offline

Activity: 69
Merit: 10


View Profile
April 23, 2013, 09:51:25 AM
 #1

Hi,

I checked my local version of all the block chain information, and I found there is some difference between my block chain and the info displayed on blockchain.info website. Initially the difference is about block size information. After some block height (sorry I don't check exact height number), there is around 2 or 3 bytes difference of the block size. Also the prevhash and merkel root is consistent.

But I also found there is difference between the hash record field after some block height. I know there is a fork between 0.7 and 0.8 version of bitcoin client and then I checked my local block chain very carefully and found that the fork happed somewhere in the file blk00049.dat some time between that famous incident.

I am using v0.8.1-beta bitcoin-qt client. I thought this version should be the right version but this strange thing happened here. Please someone help me with this and tell me I am making some stupid mistake here... Otherwise...... Is my client fooled by some other network?
coldguy (OP)
Member
**
Offline Offline

Activity: 69
Merit: 10


View Profile
April 23, 2013, 11:18:00 AM
 #2

I found the problem, it seems the blk000xx.dat file also has orphaned blocks in it, because I have located the fork and noticed there is only one branch alive.

It seems not a good idea to make orphaned blocks in the main chain, or there is other usage of them so they are still stored there after some other longer branch has been found?
TierNolan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1083


View Profile
April 23, 2013, 11:23:18 AM
 #3

It seems not a good idea to make orphaned blocks in the main chain, or there is other usage of them so they are still stored there after some other longer branch has been found?

I think the point is that the chain is really a tree due to the orphans.  Once a block is verified, it can be added to the file.  Since most verified blocks are not orphans, adding them to the file doesn't use up much space.  It means that you don't need to handle file fragmentation.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
coldguy (OP)
Member
**
Offline Offline

Activity: 69
Merit: 10


View Profile
April 23, 2013, 02:07:05 PM
 #4

The fork in my local block chain happend quite recently, definitely happened this year. I am not sure when the first orphaned block found in the main block chain, but may not be this year.

Is it the case that the newly syncronized client will not get the orphaned block but if your client is online during the broadcast of the orphaned block you may get the block and stored them on the local database? I am sorry i am not reading the source code of the client but anyone who is farmilar with it thank you for the reply.

BR
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


Ian Knowles - CIYAM Lead Developer


View Profile WWW
April 23, 2013, 02:11:02 PM
 #5

Orphan blocks happen fairly regularly (generally only to a depth of 1 and apart from the well known fork problem am not sure if there have been other orphans of greater depth than 1 but it is of course entirely possible).

If your client receives a block that is later orphaned then it will be stored (and AFAIA will not be removed), however, it doesn't cause any problems as these blocks will effectively be ignored once a longer chain has been accepted.

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
coldguy (OP)
Member
**
Offline Offline

Activity: 69
Merit: 10


View Profile
April 23, 2013, 03:21:40 PM
 #6

Orphan blocks happen fairly regularly (generally only to a depth of 1 and apart from the well known fork problem am not sure if there have been other orphans of greater depth than 1 but it is of course entirely possible).

If your client receives a block that is later orphaned then it will be stored (and AFAIA will not be removed), however, it doesn't cause any problems as these blocks will effectively be ignored once a longer chain has been accepted.


Thanks!

I think I have to modify my program to verify if the chain is in order and manually remove the orphaned block. A nice programming pratice anyway.
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!