mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
Fix: fundee can forget channel if it receives error during CHANNELD_AWAITING_LOCKIN
This commit is contained in:
@@ -441,9 +441,18 @@ void channel_errmsg(struct channel *channel,
|
||||
* - MUST fail the channel referred to by the error message,
|
||||
* if that channel is with the sending node.
|
||||
*/
|
||||
channel_fail_permanent(channel, "%s: %s ERROR %s",
|
||||
channel->owner->name,
|
||||
err_for_them ? "sent" : "received", desc);
|
||||
|
||||
/* We should immediately forget the channel if we receive error during
|
||||
* CHANNELD_AWAITING_LOCKIN if we are fundee. */
|
||||
if (!err_for_them && channel->funder == REMOTE
|
||||
&& channel->state == CHANNELD_AWAITING_LOCKIN)
|
||||
channel_fail_forget(channel, "%s: %s ERROR %s",
|
||||
channel->owner->name,
|
||||
err_for_them ? "sent" : "received", desc);
|
||||
else
|
||||
channel_fail_permanent(channel, "%s: %s ERROR %s",
|
||||
channel->owner->name,
|
||||
err_for_them ? "sent" : "received", desc);
|
||||
}
|
||||
|
||||
struct peer_connected_hook_payload {
|
||||
|
||||
Reference in New Issue
Block a user