mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
lightningd: fix crash when htlc failed and source is onchain.
If the source channel is onchain, we try to send a message to onchaind which (1) doesn't care, (2) doesn't take a channel_fail_htlc msg, and (3) causes us to crash in subd.c: assert(!strstarts(sd->msgname(fromwire_peektype(msg_out)), "INVALID")); Fixes: #821 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
e92b710406
commit
1192f16733
@ -105,6 +105,10 @@ static void fail_in_htlc(struct htlc_in *hin,
|
||||
if (!hin->key.channel->owner)
|
||||
return;
|
||||
|
||||
/* onchaind doesn't care, it can't do anything but wait */
|
||||
if (channel_on_chain(hin->key.channel))
|
||||
return;
|
||||
|
||||
subd_send_msg(hin->key.channel->owner,
|
||||
take(towire_channel_fail_htlc(hin,
|
||||
hin->key.id,
|
||||
|
Loading…
Reference in New Issue
Block a user