mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-04 23:04:35 +01:00
lightningd: handle channel cleanups more explicitly.
1. Freeing an unconfirmed channel already releases the subd, so don't do that explicitly. 2. Use channel->owner to transfer ownership where possible, using channel_set_owner() which handles all the cases. This simplifies the code and makes it more readable, IMHO. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -888,7 +888,7 @@ struct subd *subd_shutdown(struct subd *sd, unsigned int seconds)
|
||||
return tal_free(sd);
|
||||
}
|
||||
|
||||
void subd_release_channel(struct subd *owner, void *channel)
|
||||
void subd_release_channel(struct subd *owner, const void *channel)
|
||||
{
|
||||
/* If owner is a per-peer-daemon, and not already freeing itself... */
|
||||
if (owner->channel) {
|
||||
|
||||
Reference in New Issue
Block a user