diff --git a/lightningd/Makefile b/lightningd/Makefile index be8e43e9e..1a054346c 100644 --- a/lightningd/Makefile +++ b/lightningd/Makefile @@ -83,6 +83,7 @@ LIGHTNINGD_SRC := \ lightningd/pay.c \ lightningd/peer_control.c \ lightningd/peer_htlcs.c \ + lightningd/peer_comms.c \ lightningd/ping.c \ lightningd/plugin.c \ lightningd/plugin_hook.c \ diff --git a/lightningd/channel_control.c b/lightningd/channel_control.c index 6d49c9e93..a8e1bbed3 100644 --- a/lightningd/channel_control.c +++ b/lightningd/channel_control.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -182,19 +183,21 @@ static void peer_start_closingd_after_shutdown(struct channel *channel, const u8 *msg, const int *fds) { - struct crypto_state cs; + struct peer_comms *pcomms = new_peer_comms(msg); /* We expect 2 fds. */ assert(tal_count(fds) == 2); - if (!fromwire_channel_shutdown_complete(msg, &cs)) { + if (!fromwire_channel_shutdown_complete(msg, &pcomms->cs)) { channel_internal_error(channel, "bad shutdown_complete: %s", tal_hex(msg, msg)); return; } + pcomms->peer_fd = fds[0]; + pcomms->gossip_fd = fds[1]; /* This sets channel->owner, closes down channeld. */ - peer_start_closingd(channel, &cs, fds[0], fds[1], false, NULL); + peer_start_closingd(channel, pcomms, false, NULL); channel_set_state(channel, CHANNELD_SHUTTING_DOWN, CLOSINGD_SIGEXCHANGE); } @@ -253,8 +256,7 @@ static unsigned channel_msg(struct subd *sd, const u8 *msg, const int *fds) } void peer_start_channeld(struct channel *channel, - const struct crypto_state *cs, - int peer_fd, int gossip_fd, + struct peer_comms *pcomms, const u8 *funding_signed, bool reconnected) { @@ -288,8 +290,8 @@ void peer_start_channeld(struct channel *channel, channel_msg, channel_errmsg, channel_set_billboard, - take(&peer_fd), - take(&gossip_fd), + take(&pcomms->peer_fd), + take(&pcomms->gossip_fd), take(&hsmfd), NULL), false); @@ -356,7 +358,7 @@ void peer_start_channeld(struct channel *channel, feerate_min(ld, NULL), feerate_max(ld, NULL), &channel->last_sig, - cs, + &pcomms->cs, &channel->channel_info.remote_fundingkey, &channel->channel_info.theirbase, &channel->channel_info.remote_per_commit, diff --git a/lightningd/channel_control.h b/lightningd/channel_control.h index 3e62150cf..57c168db0 100644 --- a/lightningd/channel_control.h +++ b/lightningd/channel_control.h @@ -7,10 +7,10 @@ struct channel; struct crypto_state; struct lightningd; +struct peer_comms; void peer_start_channeld(struct channel *channel, - const struct crypto_state *cs, - int peer_fd, int gossip_fd, + struct peer_comms *pcomms, const u8 *funding_signed, bool reconnected); diff --git a/lightningd/closing_control.c b/lightningd/closing_control.c index a3efe0cd7..b816056da 100644 --- a/lightningd/closing_control.c +++ b/lightningd/closing_control.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -152,8 +153,7 @@ static unsigned closing_msg(struct subd *sd, const u8 *msg, const int *fds UNUSE } void peer_start_closingd(struct channel *channel, - const struct crypto_state *cs, - int peer_fd, int gossip_fd, + struct peer_comms *pcomms, bool reconnected, const u8 *channel_reestablish) { @@ -183,7 +183,8 @@ void peer_start_closingd(struct channel *channel, closing_wire_type_name, closing_msg, channel_errmsg, channel_set_billboard, - take(&peer_fd), take(&gossip_fd), + take(&pcomms->peer_fd), + take(&pcomms->gossip_fd), take(&hsmfd), NULL), false); @@ -263,7 +264,7 @@ void peer_start_closingd(struct channel *channel, return; } initmsg = towire_closing_init(tmpctx, - cs, + &pcomms->cs, &channel->funding_txid, channel->funding_outnum, channel->funding, diff --git a/lightningd/closing_control.h b/lightningd/closing_control.h index 2611d19a2..5e77c6db4 100644 --- a/lightningd/closing_control.h +++ b/lightningd/closing_control.h @@ -5,10 +5,10 @@ struct channel_id; struct crypto_state; +struct peer_comms; void peer_start_closingd(struct channel *channel, - const struct crypto_state *cs, - int peer_fd, int gossip_fd, + struct peer_comms *pcomms, bool reconnected, const u8 *channel_reestablish); diff --git a/lightningd/onchain_control.c b/lightningd/onchain_control.c index 8ae70cec9..6e53aeba9 100644 --- a/lightningd/onchain_control.c +++ b/lightningd/onchain_control.c @@ -376,8 +376,7 @@ static bool tell_if_missing(const struct channel *channel, /* Only error onchaind can get is if it dies. */ static void onchain_error(struct channel *channel, - int peer_fd UNUSED, int gossip_fd UNUSED, - const struct crypto_state *cs UNUSED, + struct peer_comms *pcomms UNUSED, const struct channel_id *channel_id UNUSED, const char *desc, const u8 *err_for_them UNUSED) diff --git a/lightningd/opening_control.c b/lightningd/opening_control.c index 83e3f5a43..325033b08 100644 --- a/lightningd/opening_control.c +++ b/lightningd/opening_control.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -290,7 +291,6 @@ static void opening_funder_finished(struct subd *openingd, const u8 *resp, struct bitcoin_tx *fundingtx; struct bitcoin_txid funding_txid, expected_txid; struct pubkey changekey; - struct crypto_state cs; struct bitcoin_signature remote_commit_sig; struct bitcoin_tx *remote_commit; u16 funding_outnum; @@ -299,8 +299,11 @@ static void opening_funder_finished(struct subd *openingd, const u8 *resp, struct channel *channel; struct lightningd *ld = openingd->ld; u8 *remote_upfront_shutdown_script; + struct peer_comms *pcomms = new_peer_comms(resp); assert(tal_count(fds) == 2); + pcomms->peer_fd = fds[0]; + pcomms->gossip_fd = fds[1]; /* This is a new channel_info.their_config so set its ID to 0 */ channel_info.their_config.id = 0; @@ -309,7 +312,7 @@ static void opening_funder_finished(struct subd *openingd, const u8 *resp, &channel_info.their_config, &remote_commit, &remote_commit_sig, - &cs, + &pcomms->cs, &channel_info.theirbase.revocation, &channel_info.theirbase.payment, &channel_info.theirbase.htlc, @@ -455,7 +458,7 @@ static void opening_funder_finished(struct subd *openingd, const u8 *resp, wallet_confirm_utxos(ld->wallet, fc->wtx.utxos); /* Start normal channel daemon. */ - peer_start_channeld(channel, &cs, fds[0], fds[1], NULL, false); + peer_start_channeld(channel, pcomms, NULL, false); subd_release_channel(openingd, fc->uc); fc->uc->openingd = NULL; @@ -463,8 +466,6 @@ static void opening_funder_finished(struct subd *openingd, const u8 *resp, return; failed: - close(fds[0]); - close(fds[1]); subd_release_channel(openingd, fc->uc); fc->uc->openingd = NULL; /* Frees fc too, and tmpctx */ @@ -478,7 +479,6 @@ static void opening_fundee_finished(struct subd *openingd, { u8 *funding_signed; struct channel_info channel_info; - struct crypto_state cs; struct bitcoin_signature remote_commit_sig; struct bitcoin_tx *remote_commit; struct lightningd *ld = openingd->ld; @@ -490,9 +490,12 @@ static void opening_fundee_finished(struct subd *openingd, u8 channel_flags; struct channel *channel; u8 *remote_upfront_shutdown_script; + struct peer_comms *pcomms = new_peer_comms(reply); log_debug(uc->log, "Got opening_fundee_finish_response"); assert(tal_count(fds) == 2); + pcomms->peer_fd = fds[0]; + pcomms->gossip_fd = fds[1]; /* This is a new channel_info.their_config, set its ID to 0 */ channel_info.their_config.id = 0; @@ -501,7 +504,7 @@ static void opening_fundee_finished(struct subd *openingd, &channel_info.their_config, &remote_commit, &remote_commit_sig, - &cs, + &pcomms->cs, &channel_info.theirbase.revocation, &channel_info.theirbase.payment, &channel_info.theirbase.htlc, @@ -554,8 +557,7 @@ static void opening_fundee_finished(struct subd *openingd, channel_watch_funding(ld, channel); /* On to normal operation! */ - peer_start_channeld(channel, &cs, - fds[0], fds[1], funding_signed, false); + peer_start_channeld(channel, pcomms, funding_signed, false); subd_release_channel(openingd, uc); uc->openingd = NULL; @@ -592,16 +594,13 @@ static void opening_funder_failed(struct subd *openingd, const u8 *msg, } static void opening_channel_errmsg(struct uncommitted_channel *uc, - int peer_fd, int gossip_fd, - const struct crypto_state *cs, + struct peer_comms *pcomms, const struct channel_id *channel_id UNUSED, const char *desc, const u8 *err_for_them UNUSED) { - if (peer_fd != -1) { - close(peer_fd); - close(gossip_fd); - } + /* Close fds, if any. */ + tal_free(pcomms); uncommitted_channel_disconnect(uc, desc); tal_free(uc); } @@ -774,8 +773,7 @@ static unsigned int openingd_msg(struct subd *openingd, } void peer_start_openingd(struct peer *peer, - const struct crypto_state *cs, - int peer_fd, int gossip_fd, + struct peer_comms *pcomms, const u8 *send_msg) { int hsmfd; @@ -799,7 +797,8 @@ void peer_start_openingd(struct peer *peer, openingd_msg, opening_channel_errmsg, opening_channel_set_billboard, - take(&peer_fd), take(&gossip_fd), + take(&pcomms->peer_fd), + take(&pcomms->gossip_fd), take(&hsmfd), NULL); if (!uc->openingd) { uncommitted_channel_disconnect(uc, @@ -826,7 +825,7 @@ void peer_start_openingd(struct peer *peer, &uc->our_config, max_to_self_delay, min_effective_htlc_capacity, - cs, &uc->local_basepoints, + &pcomms->cs, &uc->local_basepoints, &uc->local_funding_pubkey, uc->minimum_depth, feerate_min(peer->ld, NULL), diff --git a/lightningd/opening_control.h b/lightningd/opening_control.h index 616ae1680..8758bc350 100644 --- a/lightningd/opening_control.h +++ b/lightningd/opening_control.h @@ -7,14 +7,14 @@ struct channel_id; struct crypto_state; struct json_stream; struct lightningd; +struct peer_comms; struct uncommitted_channel; void json_add_uncommitted_channel(struct json_stream *response, const struct uncommitted_channel *uc); void peer_start_openingd(struct peer *peer, - const struct crypto_state *cs, - int peer_fd, int gossip_fd, + struct peer_comms *pcomms, const u8 *msg); void opening_peer_no_active_channels(struct peer *peer); diff --git a/lightningd/peer_comms.c b/lightningd/peer_comms.c new file mode 100644 index 000000000..d8b30ce3b --- /dev/null +++ b/lightningd/peer_comms.c @@ -0,0 +1,18 @@ +#include +#include + +static void destroy_peer_comms(struct peer_comms *pcomms) +{ + if (pcomms->peer_fd != -1) + close(pcomms->peer_fd); + if (pcomms->gossip_fd != -1) + close(pcomms->gossip_fd); +} + +struct peer_comms *new_peer_comms(const tal_t *ctx) +{ + struct peer_comms *pcomms = tal(ctx, struct peer_comms); + + tal_add_destructor(pcomms, destroy_peer_comms); + return pcomms; +} diff --git a/lightningd/peer_comms.h b/lightningd/peer_comms.h new file mode 100644 index 000000000..e5c194a1b --- /dev/null +++ b/lightningd/peer_comms.h @@ -0,0 +1,16 @@ +#ifndef LIGHTNING_LIGHTNINGD_PEER_COMMS_H +#define LIGHTNING_LIGHTNINGD_PEER_COMMS_H +#include "config.h" + +#include +#include + +/* Things we hand between daemons to talk to peers. */ +struct peer_comms { + struct crypto_state cs; + /* If not -1, closed on freeing */ + int peer_fd, gossip_fd; +}; + +struct peer_comms *new_peer_comms(const tal_t *ctx); +#endif /* LIGHTNING_LIGHTNINGD_PEER_COMMS_H */ diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 84534085f..eec6405d5 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -369,14 +370,13 @@ void drop_to_chain(struct lightningd *ld, struct channel *channel, } void channel_errmsg(struct channel *channel, - int peer_fd, int gossip_fd, - const struct crypto_state *cs, + struct peer_comms *pcomms, const struct channel_id *channel_id UNUSED, const char *desc, const u8 *err_for_them) { - /* No peer fd means a subd crash or disconnection. */ - if (peer_fd == -1) { + /* No peer_comms means a subd crash or disconnection. */ + if (!pcomms) { channel_fail_transient(channel, "%s: %s", channel->owner->name, desc); return; @@ -418,12 +418,10 @@ void channel_errmsg(struct channel *channel, struct peer_connected_hook_payload { struct lightningd *ld; - struct crypto_state crypto_state; struct channel *channel; struct wireaddr_internal addr; struct peer *peer; - int peer_fd; - int gossip_fd; + struct peer_comms *pcomms; }; static void json_add_htlcs(struct lightningd *ld, @@ -685,12 +683,9 @@ peer_connected_hook_cb(struct peer_connected_hook_payload *payload, const jsmntok_t *toks) { struct lightningd *ld = payload->ld; - struct crypto_state *cs = &payload->crypto_state; struct channel *channel = payload->channel; struct wireaddr_internal addr = payload->addr; struct peer *peer = payload->peer; - int gossip_fd = payload->gossip_fd; - int peer_fd = payload->peer_fd; u8 *error; /* If we had a hook, interpret result. */ @@ -713,7 +708,6 @@ peer_connected_hook_cb(struct peer_connected_hook_payload *payload, buffer + m->start); goto send_error; } - close(peer_fd); tal_free(payload); return; } else if (!json_tok_streq(buffer, resulttok, "continue")) @@ -766,8 +760,7 @@ peer_connected_hook_cb(struct peer_connected_hook_payload *payload, assert(!channel->owner); channel->peer->addr = addr; - peer_start_channeld(channel, cs, - peer_fd, gossip_fd, NULL, + peer_start_channeld(channel, payload->pcomms, NULL, true); tal_free(payload); return; @@ -776,8 +769,7 @@ peer_connected_hook_cb(struct peer_connected_hook_payload *payload, assert(!channel->owner); channel->peer->addr = addr; - peer_start_closingd(channel, cs, - peer_fd, gossip_fd, + peer_start_closingd(channel, payload->pcomms, true, NULL); tal_free(payload); return; @@ -791,7 +783,7 @@ peer_connected_hook_cb(struct peer_connected_hook_payload *payload, error = NULL; send_error: - peer_start_openingd(peer, cs, peer_fd, gossip_fd, error); + peer_start_openingd(peer, payload->pcomms, error); tal_free(payload); } @@ -812,11 +804,13 @@ void peer_connected(struct lightningd *ld, const u8 *msg, hook_payload = tal(NULL, struct peer_connected_hook_payload); hook_payload->ld = ld; - hook_payload->gossip_fd = gossip_fd; - hook_payload->peer_fd = peer_fd; + hook_payload->pcomms = new_peer_comms(hook_payload); + hook_payload->pcomms->peer_fd = peer_fd; + hook_payload->pcomms->gossip_fd = gossip_fd; if (!fromwire_connect_peer_connected(msg, msg, - &id, &hook_payload->addr, &hook_payload->crypto_state, + &id, &hook_payload->addr, + &hook_payload->pcomms->cs, &globalfeatures, &localfeatures)) fatal("Connectd gave bad CONNECT_PEER_CONNECTED message %s", tal_hex(msg, msg)); diff --git a/lightningd/peer_control.h b/lightningd/peer_control.h index a7d13054a..f4b1d4f23 100644 --- a/lightningd/peer_control.h +++ b/lightningd/peer_control.h @@ -15,7 +15,7 @@ #include #include -struct crypto_state; +struct peer_comms; struct peer { /* Inside ld->peers. */ @@ -75,8 +75,7 @@ void peer_connected(struct lightningd *ld, const u8 *msg, #define OUR_CHANNEL_FLAGS CHANNEL_FLAGS_ANNOUNCE_CHANNEL void channel_errmsg(struct channel *channel, - int peer_fd, int gossip_fd, - const struct crypto_state *cs, + struct peer_comms *pcomms, const struct channel_id *channel_id, const char *desc, const u8 *err_for_them); diff --git a/lightningd/subd.c b/lightningd/subd.c index 62c9361be..483ac3f6e 100644 --- a/lightningd/subd.c +++ b/lightningd/subd.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -367,18 +368,20 @@ static bool handle_peer_error(struct subd *sd, const u8 *msg, int fds[2]) void *channel = sd->channel; struct channel_id channel_id; char *desc; - struct crypto_state cs; + struct peer_comms *pcomms = new_peer_comms(msg); u8 *err_for_them; if (!fromwire_status_peer_error(msg, msg, &channel_id, &desc, - &cs, &err_for_them)) + &pcomms->cs, &err_for_them)) return false; - /* Don't free sd; we're may be about to free channel. */ + pcomms->peer_fd = fds[0]; + pcomms->gossip_fd = fds[1]; + + /* Don't free sd; we may be about to free channel. */ sd->channel = NULL; - sd->errcb(channel, fds[0], fds[1], &cs, - &channel_id, desc, err_for_them); + sd->errcb(channel, pcomms, &channel_id, desc, err_for_them); return true; } @@ -558,7 +561,7 @@ static void destroy_subd(struct subd *sd) if (!outer_transaction) db_begin_transaction(db); if (sd->errcb) - sd->errcb(channel, -1, -1, NULL, NULL, + sd->errcb(channel, NULL, NULL, tal_fmt(sd, "Owning subdaemon %s died (%i)", sd->name, status), NULL); @@ -608,8 +611,7 @@ static struct subd *new_subd(struct lightningd *ld, unsigned int (*msgcb)(struct subd *, const u8 *, const int *fds), void (*errcb)(void *channel, - int peer_fd, int gossip_fd, - const struct crypto_state *cs, + struct peer_comms *pcomms, const struct channel_id *channel_id, const char *desc, const u8 *err_for_them), @@ -699,8 +701,7 @@ struct subd *new_channel_subd_(struct lightningd *ld, unsigned int (*msgcb)(struct subd *, const u8 *, const int *fds), void (*errcb)(void *channel, - int peer_fd, int gossip_fd, - const struct crypto_state *cs, + struct peer_comms *pcomms, const struct channel_id *channel_id, const char *desc, const u8 *err_for_them), diff --git a/lightningd/subd.h b/lightningd/subd.h index 2cfaf3957..459a0b972 100644 --- a/lightningd/subd.h +++ b/lightningd/subd.h @@ -11,6 +11,7 @@ struct crypto_state; struct io_conn; +struct peer_comms; /* By convention, replies are requests + 100 */ #define SUBD_REPLY_OFFSET 100 @@ -38,12 +39,11 @@ struct subd { unsigned (*msgcb)(struct subd *, const u8 *, const int *); const char *(*msgname)(int msgtype); - /* If peer_fd == -1, it was a disconnect/crash. Otherwise, + /* If peer_comms == NULL, it was a disconnect/crash. Otherwise, * sufficient information to hand back to gossipd, including the * error message we sent them if any. */ void (*errcb)(void *channel, - int peer_fd, int gossip_fd, - const struct crypto_state *cs, + struct peer_comms *pcomms, const struct channel_id *channel_id, const char *desc, const u8 *err_for_them); @@ -117,8 +117,7 @@ struct subd *new_channel_subd_(struct lightningd *ld, unsigned int (*msgcb)(struct subd *, const u8 *, const int *fds), void (*errcb)(void *channel, - int peer_fd, int gossip_fd, - const struct crypto_state *cs, + struct peer_comms *pcomms, const struct channel_id *channel_id, const char *desc, const u8 *err_for_them), @@ -131,8 +130,8 @@ struct subd *new_channel_subd_(struct lightningd *ld, new_channel_subd_((ld), (name), (channel), (log), (talks_to_peer), \ (msgname), (msgcb), \ typesafe_cb_postargs(void, void *, (errcb), \ - (channel), int, int, \ - const struct crypto_state *, \ + (channel), \ + struct peer_comms *, \ const struct channel_id *, \ const char *, const u8 *), \ typesafe_cb_postargs(void, void *, (billboardcb), \ diff --git a/lightningd/test/run-find_my_abspath.c b/lightningd/test/run-find_my_abspath.c index f8b8e3cda..f05707e25 100644 --- a/lightningd/test/run-find_my_abspath.c +++ b/lightningd/test/run-find_my_abspath.c @@ -124,6 +124,9 @@ struct log *new_log(const tal_t *ctx UNNEEDED, struct log_book *record UNNEEDED, struct log_book *new_log_book(size_t max_mem UNNEEDED, enum log_level printlevel UNNEEDED) { fprintf(stderr, "new_log_book called!\n"); abort(); } +/* Generated stub for new_peer_comms */ +struct peer_comms *new_peer_comms(const tal_t *ctx UNNEEDED) +{ fprintf(stderr, "new_peer_comms called!\n"); abort(); } /* Generated stub for new_topology */ struct chain_topology *new_topology(struct lightningd *ld UNNEEDED, struct log *log UNNEEDED) { fprintf(stderr, "new_topology called!\n"); abort(); } diff --git a/lightningd/test/run-invoice-select-inchan.c b/lightningd/test/run-invoice-select-inchan.c index 0befd3343..5be68e8e0 100644 --- a/lightningd/test/run-invoice-select-inchan.c +++ b/lightningd/test/run-invoice-select-inchan.c @@ -260,6 +260,9 @@ struct log *new_log(const tal_t *ctx UNNEEDED, struct log_book *record UNNEEDED, struct log_book *new_log_book(size_t max_mem UNNEEDED, enum log_level printlevel UNNEEDED) { fprintf(stderr, "new_log_book called!\n"); abort(); } +/* Generated stub for new_peer_comms */ +struct peer_comms *new_peer_comms(const tal_t *ctx UNNEEDED) +{ fprintf(stderr, "new_peer_comms called!\n"); abort(); } /* Generated stub for new_reltimer_ */ struct oneshot *new_reltimer_(struct timers *timers UNNEEDED, const tal_t *ctx UNNEEDED, @@ -367,22 +370,19 @@ void peer_memleak_done(struct command *cmd UNNEEDED, struct subd *leaker UNNEEDE { fprintf(stderr, "peer_memleak_done called!\n"); abort(); } /* Generated stub for peer_start_channeld */ void peer_start_channeld(struct channel *channel UNNEEDED, - const struct crypto_state *cs UNNEEDED, - int peer_fd UNNEEDED, int gossip_fd UNNEEDED, + struct peer_comms *pcomms UNNEEDED, const u8 *funding_signed UNNEEDED, bool reconnected UNNEEDED) { fprintf(stderr, "peer_start_channeld called!\n"); abort(); } /* Generated stub for peer_start_closingd */ void peer_start_closingd(struct channel *channel UNNEEDED, - const struct crypto_state *cs UNNEEDED, - int peer_fd UNNEEDED, int gossip_fd UNNEEDED, + struct peer_comms *pcomms UNNEEDED, bool reconnected UNNEEDED, const u8 *channel_reestablish UNNEEDED) { fprintf(stderr, "peer_start_closingd called!\n"); abort(); } /* Generated stub for peer_start_openingd */ void peer_start_openingd(struct peer *peer UNNEEDED, - const struct crypto_state *cs UNNEEDED, - int peer_fd UNNEEDED, int gossip_fd UNNEEDED, + struct peer_comms *pcomms UNNEEDED, const u8 *msg UNNEEDED) { fprintf(stderr, "peer_start_openingd called!\n"); abort(); } /* Generated stub for plugin_hook_call_ */ diff --git a/wallet/test/run-wallet.c b/wallet/test/run-wallet.c index d0790a582..7929ed4ab 100644 --- a/wallet/test/run-wallet.c +++ b/wallet/test/run-wallet.c @@ -329,6 +329,9 @@ void log_add(struct log *log UNNEEDED, const char *fmt UNNEEDED, ...) void log_io(struct log *log UNNEEDED, enum log_level dir UNNEEDED, const char *comment UNNEEDED, const void *data UNNEEDED, size_t len UNNEEDED) { fprintf(stderr, "log_io called!\n"); abort(); } +/* Generated stub for new_peer_comms */ +struct peer_comms *new_peer_comms(const tal_t *ctx UNNEEDED) +{ fprintf(stderr, "new_peer_comms called!\n"); abort(); } /* Generated stub for notify_connect */ void notify_connect(struct lightningd *ld UNNEEDED, struct node_id *nodeid UNNEEDED, struct wireaddr_internal *addr UNNEEDED) @@ -432,22 +435,19 @@ void peer_memleak_done(struct command *cmd UNNEEDED, struct subd *leaker UNNEEDE { fprintf(stderr, "peer_memleak_done called!\n"); abort(); } /* Generated stub for peer_start_channeld */ void peer_start_channeld(struct channel *channel UNNEEDED, - const struct crypto_state *cs UNNEEDED, - int peer_fd UNNEEDED, int gossip_fd UNNEEDED, + struct peer_comms *pcomms UNNEEDED, const u8 *funding_signed UNNEEDED, bool reconnected UNNEEDED) { fprintf(stderr, "peer_start_channeld called!\n"); abort(); } /* Generated stub for peer_start_closingd */ void peer_start_closingd(struct channel *channel UNNEEDED, - const struct crypto_state *cs UNNEEDED, - int peer_fd UNNEEDED, int gossip_fd UNNEEDED, + struct peer_comms *pcomms UNNEEDED, bool reconnected UNNEEDED, const u8 *channel_reestablish UNNEEDED) { fprintf(stderr, "peer_start_closingd called!\n"); abort(); } /* Generated stub for peer_start_openingd */ void peer_start_openingd(struct peer *peer UNNEEDED, - const struct crypto_state *cs UNNEEDED, - int peer_fd UNNEEDED, int gossip_fd UNNEEDED, + struct peer_comms *pcomms UNNEEDED, const u8 *msg UNNEEDED) { fprintf(stderr, "peer_start_openingd called!\n"); abort(); } /* Generated stub for plugin_hook_call_ */