Bitcoin Forum
October 18, 2018, 10:47:19 AM *
News: Make sure you are not using versions of Bitcoin Core other than 0.17.0 [Torrent], 0.16.3, 0.15.2, or 0.14.3. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: what is the struct of value in the leveldb when use 'b' + block hash as a key  (Read 30 times)
bigphoenixman
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
December 27, 2017, 10:17:21 AM
 #1

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" HuhHuh

plz tell me the struct or tell me which .cpp contain the struct, thanks a lot!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1539859639
Hero Member
*
Offline Offline

Posts: 1539859639

View Profile Personal Message (Offline)

Ignore
1539859639
Reply with quote  #2

1539859639
Report to moderator
1539859639
Hero Member
*
Offline Offline

Posts: 1539859639

View Profile Personal Message (Offline)

Ignore
1539859639
Reply with quote  #2

1539859639
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 1554
Merit: 1703


3F1Y9yquzvY6RWvKbw2n2zeo9V5mvBhADU


View Profile WWW
December 28, 2017, 04:22:08 AM
 #2

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.

bigphoenixman
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
December 29, 2017, 06:44:51 AM
 #3

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!
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!