Browse Source

lightningd: make peer_fail_permanent() only save the first error for peer.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
1954844fbf
  1. 6
      lightningd/peer_control.c

6
lightningd/peer_control.c

@ -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);

Loading…
Cancel
Save