mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
elements: Construct the block header hash while we parse it
This commit is contained in:
parent
8839be641a
commit
fce05d74e1
@ -52,8 +52,11 @@ bitcoin_block_from_hex(const tal_t *ctx, const struct chainparams *chainparams,
|
||||
if (is_elements(chainparams)) {
|
||||
b->elements_hdr = tal(b, struct elements_block_hdr);
|
||||
b->elements_hdr->block_height = pull_le32(&p, &len);
|
||||
sha256_le32(&shactx, b->elements_hdr->block_height);
|
||||
|
||||
size_t challenge_len = pull_varint(&p, &len);
|
||||
sha256_varint(&shactx, challenge_len);
|
||||
sha256_update(&shactx, p, challenge_len);
|
||||
b->elements_hdr->proof.challenge = tal_arr(b->elements_hdr, u8, challenge_len);
|
||||
pull(&p, &len, b->elements_hdr->proof.challenge, challenge_len);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user