Title: what is the struct of value in the leveldb when use 'b' + block hash as a key Post by: bigphoenixman on December 27, 2017, 10:17:21 AM when i use 'b' + block hash as a key search the leveldb, i can not figure out the struct of values.
for exmaple: search 'b' + "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f" // Block #0 value 88bytes: 889271000b010008010000000000000000000000000000000000000000000000000000000000000 0000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f 49ffff001d1dac2b7c i know the last 80bytes is the block header, but the first 8bytes , i do not known what it is? "889271000b010008" ?????? plz tell me the struct or tell me which .cpp contain the struct, thanks a lot! Title: Re: what is the struct of value in the leveldb when use 'b' + block hash as a key Post by: achow101 on December 28, 2017, 04:22:08 AM There is no struct; it is a class that has a specific serialization. The implementation details can be found here: https://github.com/bitcoin/bitcoin/blob/master/src/chain.h#L370. The other stuff there (which can vary for each block), include the block's position on disk, its height, and the number of transactions.
Title: Re: what is the struct of value in the leveldb when use 'b' + block hash as a key Post by: bigphoenixman on December 29, 2017, 06:44:51 AM There is no struct; it is a class that has a specific serialization. The implementation details can be found here: https://github.com/bitcoin/bitcoin/blob/master/src/chain.h#L370. The other stuff there (which can vary for each block), include the block's position on disk, its height, and the number of transactions. Thanks! |