Bitcoin Forum
May 11, 2024, 02:33:11 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: what is the struct of value in the leveldb when use 'b' + block hash as a key  (Read 125 times)
bigphoenixman (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 3


View Profile
December 27, 2017, 10:17:21 AM
Merited by ABCbits (1)
 #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!
1715437991
Hero Member
*
Offline Offline

Posts: 1715437991

View Profile Personal Message (Offline)

Ignore
1715437991
Reply with quote  #2

1715437991
Report to moderator
1715437991
Hero Member
*
Offline Offline

Posts: 1715437991

View Profile Personal Message (Offline)

Ignore
1715437991
Reply with quote  #2

1715437991
Report to moderator
Transactions must be included in a block to be properly completed. When you send a transaction, it is broadcast to miners. Miners can then optionally include it in their next blocks. Miners will be more inclined to include your transaction if it has a higher transaction fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715437991
Hero Member
*
Offline Offline

Posts: 1715437991

View Profile Personal Message (Offline)

Ignore
1715437991
Reply with quote  #2

1715437991
Report to moderator
1715437991
Hero Member
*
Offline Offline

Posts: 1715437991

View Profile Personal Message (Offline)

Ignore
1715437991
Reply with quote  #2

1715437991
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6635


Just writing some code


View Profile WWW
December 28, 2017, 04:22:08 AM
Merited by ABCbits (2)
 #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 (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 3


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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!