diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index e2f49615e..4d5ca1389 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -693,7 +693,7 @@ static u8 *make_failmsg(const tal_t *ctx, const struct htlc_end *hend, case WIRE_INVALID_ONION_KEY: return towire_invalid_onion_key(ctx, onion_sha); case WIRE_TEMPORARY_CHANNEL_FAILURE: - return towire_temporary_channel_failure(ctx); + return towire_temporary_channel_failure(ctx, channel_update); case WIRE_PERMANENT_CHANNEL_FAILURE: return towire_permanent_channel_failure(ctx); case WIRE_REQUIRED_CHANNEL_FEATURE_MISSING: @@ -901,7 +901,10 @@ static struct peer *peer_by_pubkey(struct lightningd *ld, const struct pubkey *i */ static void hend_subd_died(struct htlc_end *hend) { - u8 *failmsg = towire_temporary_channel_failure(hend->other_end); + /* FIXME: Ask gossip daemon for channel_update. */ + u8 *channel_update = NULL; + u8 *failmsg = towire_temporary_channel_failure(hend->other_end, + channel_update); u8 *msg = towire_channel_fail_htlc(hend->other_end, hend->other_end->htlc_id, failmsg); @@ -1199,6 +1202,8 @@ static int peer_failed_htlc(struct peer *peer, const u8 *msg) static u8 *malformed_msg(const tal_t *ctx, enum onion_type type, const struct sha256 *sha256_of_onion) { + u8 *channel_update; + /* FIXME: check the reported SHA matches what we sent! */ switch (type) { case WIRE_INVALID_ONION_VERSION: @@ -1208,8 +1213,9 @@ static u8 *malformed_msg(const tal_t *ctx, enum onion_type type, case WIRE_INVALID_ONION_KEY: return towire_invalid_onion_key(ctx, sha256_of_onion); default: - /* FIXME */ - return towire_temporary_channel_failure(ctx); + /* FIXME: Ask gossip daemon for channel_update. */ + channel_update = NULL; + return towire_temporary_channel_failure(ctx, channel_update); } } diff --git a/wire/gen_onion_wire_csv b/wire/gen_onion_wire_csv index 8502563cf..f885adaf2 100644 --- a/wire/gen_onion_wire_csv +++ b/wire/gen_onion_wire_csv @@ -10,6 +10,8 @@ invalid_onion_hmac,0,sha256-of-onion,32 invalid_onion_key,BADONION|PERM|6 invalid_onion_key,0,sha256-of-onion,32 temporary_channel_failure,7 +temporary_channel_failure,0,len,2 +temporary_channel_failure,2,channel_update,len permanent_channel_failure,PERM|8 required_channel_feature_missing,PERM|9 unknown_next_peer,PERM|10