bitcoin: Compute block hash while parsing

This avoids having to re-serialize the block header just to compute the
hash. It also frees us from having to carry around all the details in the
header and we can hand around a minimal version.
This commit is contained in:
Christian Decker
2020-01-23 13:38:13 +01:00
parent 62e9ad1139
commit c2434ad4fb
2 changed files with 15 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ struct bitcoin_block_hdr {
le32 timestamp;
le32 target;
le32 nonce;
struct sha256_double hash;
};
struct elements_block_proof {