mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-05 22:24:25 +01:00
lightningd: make peer_fail_permanent() only save the first error for peer.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
0b953b86fe
commit
1954844fbf
@@ -156,7 +156,11 @@ void peer_fail_permanent(struct peer *peer, const u8 *msg TAKES)
|
||||
log_unusual(peer->log, "Peer permanent failure in %s: %.*s",
|
||||
peer_state_name(peer->state),
|
||||
(int)tal_len(msg), (char *)msg);
|
||||
peer->error = towire_error(peer, &all_channels, msg);
|
||||
|
||||
/* We can have multiple errors, eg. onchaind failures. */
|
||||
if (!peer->error)
|
||||
peer->error = towire_error(peer, &all_channels, msg);
|
||||
|
||||
peer_set_owner(peer, NULL);
|
||||
if (taken(msg))
|
||||
tal_free(msg);
|
||||
|
||||
Reference in New Issue
Block a user