Browse Source

lightningd: add debugging into io_loop.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
parent
commit
66c1da795f
  1. 1
      lightningd/Makefile
  2. 3
      lightningd/lightningd.c
  3. 3
      lightningd/test/run-find_my_path.c

1
lightningd/Makefile

@ -22,6 +22,7 @@ LIGHTNINGD_COMMON_OBJS := \
common/funding_tx.o \
common/htlc_state.o \
common/htlc_wire.o \
common/io_debug.o \
common/key_derive.o \
common/json.o \
common/msg_queue.o \

3
lightningd/lightningd.c

@ -15,6 +15,7 @@
#include <ccan/tal/grab_file/grab_file.h>
#include <ccan/tal/path/path.h>
#include <ccan/tal/str/str.h>
#include <common/io_debug.h>
#include <common/timeout.h>
#include <common/utils.h>
#include <common/version.h>
@ -233,6 +234,8 @@ int main(int argc, char *argv[])
secp256k1_ctx = secp256k1_context_create(SECP256K1_CONTEXT_VERIFY
| SECP256K1_CONTEXT_SIGN);
io_poll_override(debug_poll);
/* Figure out where we are first. */
ld->daemon_dir = find_my_path(ld, argv[0]);

3
lightningd/test/run-find_my_path.c

@ -7,6 +7,9 @@ int unused_main(int argc, char *argv[]);
/* Generated stub for crashlog_activate */
void crashlog_activate(const char *argv0 UNNEEDED, struct log *log UNNEEDED)
{ fprintf(stderr, "crashlog_activate called!\n"); abort(); }
/* Generated stub for debug_poll */
int debug_poll(struct pollfd *fds UNNEEDED, nfds_t nfds UNNEEDED, int timeout UNNEEDED)
{ fprintf(stderr, "debug_poll called!\n"); abort(); }
/* Generated stub for gossip_init */
void gossip_init(struct lightningd *ld UNNEEDED)
{ fprintf(stderr, "gossip_init called!\n"); abort(); }

Loading…
Cancel
Save