lightningd: centralize refcounting behaviour for peers.

It's mildly neater this way.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-08-02 16:19:55 +09:30
parent 0ebad456b1
commit 8bffd2b604
4 changed files with 15 additions and 9 deletions

View File

@@ -586,9 +586,7 @@ static void destroy_uncommitted_channel(struct uncommitted_channel *uc)
uc->peer->uncommitted_channel = NULL;
/* Last one out frees */
if (list_empty(&uc->peer->channels))
delete_peer(uc->peer);
maybe_delete_peer(uc->peer);
}
/* Returns NULL if there's already an opening or active channel for this peer */