Browse Source

BOLT update: temporary_channel_failure with update.

Aka d140405a6f0d95e3ccf650e3560383768cbf3e03.

This doesn't make it work, just compile.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 8 years ago
committed by Christian Decker
parent
commit
e97046f797
  1. 14
      lightningd/peer_control.c
  2. 2
      wire/gen_onion_wire_csv

14
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: case WIRE_INVALID_ONION_KEY:
return towire_invalid_onion_key(ctx, onion_sha); return towire_invalid_onion_key(ctx, onion_sha);
case WIRE_TEMPORARY_CHANNEL_FAILURE: case WIRE_TEMPORARY_CHANNEL_FAILURE:
return towire_temporary_channel_failure(ctx); return towire_temporary_channel_failure(ctx, channel_update);
case WIRE_PERMANENT_CHANNEL_FAILURE: case WIRE_PERMANENT_CHANNEL_FAILURE:
return towire_permanent_channel_failure(ctx); return towire_permanent_channel_failure(ctx);
case WIRE_REQUIRED_CHANNEL_FEATURE_MISSING: 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) 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, u8 *msg = towire_channel_fail_htlc(hend->other_end,
hend->other_end->htlc_id, hend->other_end->htlc_id,
failmsg); 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, static u8 *malformed_msg(const tal_t *ctx, enum onion_type type,
const struct sha256 *sha256_of_onion) const struct sha256 *sha256_of_onion)
{ {
u8 *channel_update;
/* FIXME: check the reported SHA matches what we sent! */ /* FIXME: check the reported SHA matches what we sent! */
switch (type) { switch (type) {
case WIRE_INVALID_ONION_VERSION: 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: case WIRE_INVALID_ONION_KEY:
return towire_invalid_onion_key(ctx, sha256_of_onion); return towire_invalid_onion_key(ctx, sha256_of_onion);
default: default:
/* FIXME */ /* FIXME: Ask gossip daemon for channel_update. */
return towire_temporary_channel_failure(ctx); channel_update = NULL;
return towire_temporary_channel_failure(ctx, channel_update);
} }
} }

2
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,BADONION|PERM|6
invalid_onion_key,0,sha256-of-onion,32 invalid_onion_key,0,sha256-of-onion,32
temporary_channel_failure,7 temporary_channel_failure,7
temporary_channel_failure,0,len,2
temporary_channel_failure,2,channel_update,len
permanent_channel_failure,PERM|8 permanent_channel_failure,PERM|8
required_channel_feature_missing,PERM|9 required_channel_feature_missing,PERM|9
unknown_next_peer,PERM|10 unknown_next_peer,PERM|10

Loading…
Cancel
Save