mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 09:04:22 +01:00
bitcoind: getchaintips support.
This allows us to sae the block topology in detail. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -57,5 +57,69 @@ void bitcoind_get_mediantime(struct lightningd_state *dstate,
|
||||
const struct sha256_double *blockid,
|
||||
u32 *mediantime);
|
||||
|
||||
void bitcoind_get_chaintips_(struct lightningd_state *dstate,
|
||||
void (*cb)(struct lightningd_state *dstate,
|
||||
struct sha256_double *blockids,
|
||||
void *arg),
|
||||
void *arg);
|
||||
|
||||
#define bitcoind_get_chaintips(dstate, cb, arg) \
|
||||
bitcoind_get_chaintips_((dstate), \
|
||||
typesafe_cb_preargs(void, void *, \
|
||||
(cb), (arg), \
|
||||
struct lightningd_state *, \
|
||||
struct sha256_double *), \
|
||||
(arg))
|
||||
|
||||
void bitcoind_getblock_(struct lightningd_state *dstate,
|
||||
const struct sha256_double *blockid,
|
||||
void (*cb)(struct lightningd_state *dstate,
|
||||
struct sha256_double *blkid,
|
||||
struct sha256_double *prevblock,
|
||||
struct sha256_double *txids,
|
||||
u32 mediantime,
|
||||
void *arg),
|
||||
void *arg);
|
||||
|
||||
#define bitcoind_getblock(dstate, blockid, cb, arg) \
|
||||
bitcoind_getblock_((dstate), (blockid), \
|
||||
typesafe_cb_preargs(void, void *, \
|
||||
(cb), (arg), \
|
||||
struct lightningd_state *, \
|
||||
struct sha256_double *, \
|
||||
struct sha256_double *, \
|
||||
struct sha256_double *, \
|
||||
u32 mediantime), \
|
||||
(arg))
|
||||
|
||||
void bitcoind_getblockcount_(struct lightningd_state *dstate,
|
||||
void (*cb)(struct lightningd_state *dstate,
|
||||
u32 blockcount,
|
||||
void *arg),
|
||||
void *arg);
|
||||
|
||||
#define bitcoind_getblockcount(dstate, cb, arg) \
|
||||
bitcoind_getblockcount_((dstate), \
|
||||
typesafe_cb_preargs(void, void *, \
|
||||
(cb), (arg), \
|
||||
struct lightningd_state *, \
|
||||
u32 blockcount), \
|
||||
(arg))
|
||||
|
||||
void bitcoind_getblockhash_(struct lightningd_state *dstate,
|
||||
u32 height,
|
||||
void (*cb)(struct lightningd_state *dstate,
|
||||
const struct sha256_double *blkid,
|
||||
void *arg),
|
||||
void *arg);
|
||||
#define bitcoind_getblockhash(dstate, height, cb, arg) \
|
||||
bitcoind_getblockhash_((dstate), \
|
||||
(height), \
|
||||
typesafe_cb_preargs(void, void *, \
|
||||
(cb), (arg), \
|
||||
struct lightningd_state *, \
|
||||
const struct sha256_double *), \
|
||||
(arg))
|
||||
|
||||
void check_bitcoind_config(struct lightningd_state *dstate);
|
||||
#endif /* LIGHTNING_DAEMON_BITCOIND_H */
|
||||
|
||||
Reference in New Issue
Block a user