mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
29 lines
660 B
C
29 lines
660 B
C
|
#ifndef LIGHTNING_BITCOIN_BLOCK_H
|
||
|
#define LIGHTNING_BITCOIN_BLOCK_H
|
||
|
#include "config.h"
|
||
|
#include "bitcoin/shadouble.h"
|
||
|
#include <ccan/endian/endian.h>
|
||
|
#include <ccan/short_types/short_types.h>
|
||
|
#include <ccan/tal/tal.h>
|
||
|
#include <stdbool.h>
|
||
|
|
||
|
struct bitcoin_block_hdr {
|
||
|
le32 version;
|
||
|
struct sha256_double prev_hash;
|
||
|
struct sha256_double merkle_hash;
|
||
|
le32 timestamp;
|
||
|
le32 target;
|
||
|
le32 nonce;
|
||
|
};
|
||
|
|
||
|
struct bitcoin_block {
|
||
|
struct bitcoin_block_hdr hdr;
|
||
|
/* tal_count shows now many */
|
||
|
struct bitcoin_tx **tx;
|
||
|
};
|
||
|
|
||
|
struct bitcoin_block *bitcoin_block_from_hex(const tal_t *ctx,
|
||
|
const char *hex, size_t hexlen);
|
||
|
|
||
|
#endif /* LIGHTNING_BITCOIN_BLOCK_H */
|