mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
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>
This commit is contained in:
parent
709991fed1
commit
ce24731da9
1 changed files with 4 additions and 7 deletions
|
@ -828,10 +828,8 @@ static void fail_fundchannel_command(struct funding_channel *fc)
|
|||
static void funding_broadcast_failed(struct peer *peer,
|
||||
int exitstatus, const char *err)
|
||||
{
|
||||
log_unusual(peer->log, "Funding broadcast exited with %i: %s",
|
||||
exitstatus, err);
|
||||
/* FIXME: send PKT_ERR to peer if this happens. */
|
||||
tal_free(peer);
|
||||
peer_internal_error(peer, "Funding broadcast exited with %i: %s",
|
||||
exitstatus, err);
|
||||
}
|
||||
|
||||
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,
|
||||
&funding_txid,
|
||||
&channel_info->feerate_per_kw)) {
|
||||
log_broken(fc->peer->log, "bad OPENING_FUNDER_REPLY %s",
|
||||
tal_hex(resp, resp));
|
||||
tal_free(fc->peer);
|
||||
peer_internal_error(fc->peer, "bad shutdown_complete: %s",
|
||||
tal_hex(resp, resp));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue