bitcoind: getrawblock helper.

It turns out using the verbose=false parameter, you can get the raw block
from getblock.  Do that.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2016-04-24 19:40:29 +09:30
parent 3d9cb81215
commit e7b9a913a6
7 changed files with 135 additions and 6 deletions

View File

@@ -10,6 +10,7 @@ struct lightningd_state;
struct ripemd160;
struct bitcoin_tx;
struct peer;
struct bitcoin_block;
/* -datadir arg for bitcoin-cli. */
extern char *bitcoin_datadir;
@@ -121,6 +122,20 @@ void bitcoind_getblockhash_(struct lightningd_state *dstate,
const struct sha256_double *), \
(arg))
void bitcoind_getrawblock_(struct lightningd_state *dstate,
const struct sha256_double *blockid,
void (*cb)(struct lightningd_state *dstate,
struct bitcoin_block *blk,
void *arg),
void *arg);
#define bitcoind_getrawblock(dstate, blkid, cb, arg) \
bitcoind_getrawblock_((dstate), (blkid), \
typesafe_cb_preargs(void, void *, \
(cb), (arg), \
struct lightningd_state *, \
struct bitcoin_block *), \
(arg))
void normalized_txid(const struct bitcoin_tx *tx, struct sha256_double *txid);
void check_bitcoind_config(struct lightningd_state *dstate);