Browse Source

lightningd: use internal_error rather than freeing peer.

Should never free peer directly: we need to log error, etc.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
ce24731da9
  1. 11
      lightningd/peer_control.c

11
lightningd/peer_control.c

@ -828,10 +828,8 @@ static void fail_fundchannel_command(struct funding_channel *fc)
static void funding_broadcast_failed(struct peer *peer, static void funding_broadcast_failed(struct peer *peer,
int exitstatus, const char *err) int exitstatus, const char *err)
{ {
log_unusual(peer->log, "Funding broadcast exited with %i: %s", peer_internal_error(peer, "Funding broadcast exited with %i: %s",
exitstatus, err); exitstatus, err);
/* FIXME: send PKT_ERR to peer if this happens. */
tal_free(peer);
} }
static enum watch_result funding_announce_cb(struct peer *peer, static enum watch_result funding_announce_cb(struct peer *peer,
@ -1676,9 +1674,8 @@ static bool opening_funder_finished(struct subd *opening, const u8 *resp,
&channel_info->remote_fundingkey, &channel_info->remote_fundingkey,
&funding_txid, &funding_txid,
&channel_info->feerate_per_kw)) { &channel_info->feerate_per_kw)) {
log_broken(fc->peer->log, "bad OPENING_FUNDER_REPLY %s", peer_internal_error(fc->peer, "bad shutdown_complete: %s",
tal_hex(resp, resp)); tal_hex(resp, resp));
tal_free(fc->peer);
return false; return false;
} }

Loading…
Cancel
Save