forked from ElementsProject/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitcoind.h
56 lines (47 loc) · 1.75 KB
/
bitcoind.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef LIGHTNING_DAEMON_BITCOIND_H
#define LIGHTNING_DAEMON_BITCOIND_H
#include "config.h"
#include <ccan/short_types/short_types.h>
#include <ccan/typesafe_cb/typesafe_cb.h>
#include <stdbool.h>
struct sha256_double;
struct lightningd_state;
struct ripemd160;
struct bitcoin_tx;
struct peer;
/* -datadir arg for bitcoin-cli. */
extern char *bitcoin_datadir;
void bitcoind_watch_addr(struct lightningd_state *dstate,
const struct ripemd160 *redeemhash);
void bitcoind_poll_transactions(struct lightningd_state *dstate,
void (*cb)(struct lightningd_state *dstate,
const struct sha256_double *txid,
int confirmations,
bool is_coinbase,
const struct sha256_double *blkhash));
void bitcoind_txid_lookup_(struct lightningd_state *dstate,
const struct sha256_double *txid,
void (*cb)(struct lightningd_state *dstate,
const struct bitcoin_tx *tx, void *),
void *arg);
#define bitcoind_txid_lookup(dstate, txid, cb, arg) \
bitcoind_txid_lookup_((dstate), (txid), \
typesafe_cb_preargs(struct io_plan *, void *, \
(cb), (arg), \
struct lightningd_state *, \
const struct bitcoin_tx *), \
(arg))
void bitcoind_send_tx(struct lightningd_state *dstate,
const struct bitcoin_tx *tx);
void bitcoind_create_payment(struct lightningd_state *dstate,
const char *addr,
u64 satoshis,
void (*cb)(struct lightningd_state *dstate,
const struct bitcoin_tx *tx,
struct peer *peer),
struct peer *peer);
void bitcoind_get_mediantime(struct lightningd_state *dstate,
const struct sha256_double *blockid,
u32 *mediantime);
void check_bitcoind_config(struct lightningd_state *dstate);
#endif /* LIGHTNING_DAEMON_BITCOIND_H */