mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
daemon/watch: API to watch various bitcoin transactions.
This uses the functions in bitcoind to provide callbacks when various things happen. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -121,6 +121,8 @@ static struct lightningd_state *lightningd_state(void)
|
||||
|
||||
list_head_init(&state->peers);
|
||||
timers_init(&state->timers, time_now());
|
||||
txwatch_hash_init(&state->txwatches);
|
||||
txowatch_hash_init(&state->txowatches);
|
||||
state->secpctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY
|
||||
| SECP256K1_CONTEXT_SIGN);
|
||||
default_config(&state->config);
|
||||
@@ -203,6 +205,9 @@ int main(int argc, char *argv[])
|
||||
/* Set up node ID and private key. */
|
||||
secrets_init(state);
|
||||
|
||||
/* Create timer to do watches. */
|
||||
setup_watch_timer(state);
|
||||
|
||||
log_info(state->base_log, "Hello world!");
|
||||
|
||||
/* If io_loop returns NULL, either a timer expired, or all fds closed */
|
||||
|
||||
Reference in New Issue
Block a user