mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 22:31:48 +01:00
channeld: fill in channel_update field in errors by asking gossipd.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
933c1794a1
commit
40516941af
3 changed files with 19 additions and 5 deletions
|
@ -58,7 +58,12 @@ CHANNELD_COMMON_OBJS := \
|
|||
common/timeout.o \
|
||||
common/type_to_string.o \
|
||||
common/utils.o \
|
||||
common/version.o
|
||||
common/version.o \
|
||||
common/wireaddr.o \
|
||||
gossipd/gen_gossip_wire.o \
|
||||
lightningd/gossip_msg.o \
|
||||
wire/fromwire.o \
|
||||
wire/towire.o
|
||||
|
||||
# Control daemon uses this:
|
||||
LIGHTNINGD_CHANNEL_CONTROL_HEADERS := $(LIGHTNINGD_CHANNEL_HEADERS_GEN)
|
||||
|
|
|
@ -621,7 +621,7 @@ static u8 *master_wait_sync_reply(const tal_t *ctx,
|
|||
MASTER_FD, &peer->from_master, "master");
|
||||
}
|
||||
|
||||
static UNNEEDED u8 *gossipd_wait_sync_reply(const tal_t *ctx,
|
||||
static u8 *gossipd_wait_sync_reply(const tal_t *ctx,
|
||||
struct peer *peer, const u8 *msg,
|
||||
enum gossip_wire_type replytype)
|
||||
{
|
||||
|
@ -1954,8 +1954,17 @@ static u8 *foreign_channel_update(const tal_t *ctx,
|
|||
struct peer *peer,
|
||||
const struct short_channel_id *scid)
|
||||
{
|
||||
/* FIXME! */
|
||||
return NULL;
|
||||
tal_t *tmpctx = tal_tmpctx(ctx);
|
||||
u8 *msg, *update;
|
||||
|
||||
msg = towire_gossip_get_update(tmpctx, scid);
|
||||
msg = gossipd_wait_sync_reply(tmpctx, peer, take(msg),
|
||||
WIRE_GOSSIP_GET_UPDATE_REPLY);
|
||||
if (!fromwire_gossip_get_update_reply(ctx, msg, NULL, &update))
|
||||
status_failed(STATUS_FAIL_GOSSIP_IO,
|
||||
"Invalid update reply");
|
||||
tal_free(tmpctx);
|
||||
return update;
|
||||
}
|
||||
|
||||
static u8 *make_failmsg(const tal_t *ctx,
|
||||
|
|
|
@ -641,7 +641,7 @@ static void handle_get_update(struct peer *peer, const u8 *msg)
|
|||
|
||||
reply:
|
||||
msg = towire_gossip_get_update_reply(msg, update);
|
||||
msg_enqueue(&peer->peer_out, take(msg));
|
||||
daemon_conn_send(&peer->owner_conn, take(msg));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue