Author

Topic: Merkle tree of transaction exists in raw data file or just in memory? (Read 137 times)

legendary
Activity: 2114
Merit: 1293
There is trouble abrewing
Each block contains many transactions. In raw data, these transactions are organized like a tree or just flat array of transactions ?
in an array. each transaction comes after the other like a chain.

Quote
As my understanding, the transactions are stored like array in raw data, and bitcoin cline will build a Merkle tree for these transactions in memory. These Merkle tree , actually a group a hash value, are not written into file. Just in memory. When the bitcoin client quit, the Merkle tree is released. They are not saved in raw data.
when a node first receives the block it has to first build each branch of the merkle tree to get to the root and then see if the hash of it is the same hash that was included in the block header (that is the only hash that is stored). then it is discarded after verification (no need to quit).
jr. member
Activity: 47
Merit: 8
Each block contains many transactions. In raw data, these transactions are organized like a tree or just flat array of transactions ?

As my understanding, the transactions are stored like array in raw data, and bitcoin cline will build a Merkle tree for these transactions in memory. These Merkle tree , actually a group a hash value, are not written into file. Just in memory. When the bitcoin client quit, the Merkle tree is released. They are not saved in raw data.
Jump to: