mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-22 06:24:22 +01:00
channel: rename free_channel to delete_channel.
free_channel() sounds like a destructor. Suggested-by: @cdecker Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
d822ba1eee
commit
98de10b842
@@ -58,7 +58,7 @@ static void destroy_channel(struct channel *channel)
|
||||
}
|
||||
|
||||
/* This lets us give a more detailed error than just a destructor. */
|
||||
void free_channel(struct channel *channel, const char *why)
|
||||
void delete_channel(struct channel *channel, const char *why)
|
||||
{
|
||||
if (channel->opening_cmd) {
|
||||
command_fail(channel->opening_cmd, "%s", why);
|
||||
@@ -221,7 +221,7 @@ void channel_fail_permanent(struct channel *channel, const char *fmt, ...)
|
||||
drop_to_chain(ld, channel);
|
||||
tal_free(why);
|
||||
} else
|
||||
free_channel(channel, why);
|
||||
delete_channel(channel, why);
|
||||
}
|
||||
|
||||
void channel_internal_error(struct channel *channel, const char *fmt, ...)
|
||||
@@ -262,7 +262,7 @@ void channel_fail_transient(struct channel *channel, const char *fmt, ...)
|
||||
if (!channel_persists(channel)) {
|
||||
log_info(channel->log, "Only reached state %s: forgetting",
|
||||
channel_state_name(channel));
|
||||
free_channel(channel, why);
|
||||
delete_channel(channel, why);
|
||||
return;
|
||||
}
|
||||
tal_free(why);
|
||||
|
||||
@@ -87,7 +87,7 @@ struct channel {
|
||||
|
||||
struct channel *new_channel(struct peer *peer, u64 dbid, u32 first_blocknum);
|
||||
/* This lets us give a more detailed error than just a destructor. */
|
||||
void free_channel(struct channel *channel, const char *why);
|
||||
void delete_channel(struct channel *channel, const char *why);
|
||||
|
||||
const char *channel_state_name(const struct channel *channel);
|
||||
|
||||
|
||||
@@ -339,7 +339,7 @@ void peer_connected(struct lightningd *ld, const u8 *msg,
|
||||
|
||||
/* Reconnect: discard old one. */
|
||||
case OPENINGD:
|
||||
free_channel(channel, "peer reconnected");
|
||||
delete_channel(channel, "peer reconnected");
|
||||
channel = NULL;
|
||||
goto return_to_gossipd;
|
||||
|
||||
@@ -1104,7 +1104,7 @@ static void handle_irrevocably_resolved(struct channel *channel, const u8 *msg)
|
||||
log_info(channel->log, "onchaind complete, forgetting peer");
|
||||
|
||||
/* This will also free onchaind. */
|
||||
free_channel(channel, "onchaind complete, forgetting peer");
|
||||
delete_channel(channel, "onchaind complete, forgetting peer");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2270,7 +2270,7 @@ static unsigned int opening_negotiation_failed(struct subd *openingd,
|
||||
log_unusual(channel->log, "Opening negotiation failed: %s", why);
|
||||
|
||||
/* This will free openingd, since that's peer->owner */
|
||||
free_channel(channel, why);
|
||||
delete_channel(channel, why);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2840,7 +2840,7 @@ static void process_dev_forget_channel(struct bitcoind *bitcoind UNUSED,
|
||||
json_add_txid(response, "funding_txid", forget->channel->funding_txid);
|
||||
json_object_end(response);
|
||||
|
||||
free_channel(forget->channel, "dev-forget-channel called");
|
||||
delete_channel(forget->channel, "dev-forget-channel called");
|
||||
|
||||
command_success(forget->cmd, response);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user