utils: remove tal_tmpctx altogether, use global.

In particular, we now only free tmpctx at the end of main().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-03-15 16:40:20 +10:30
parent 40fe5b7bac
commit 0a6e3d1e13
45 changed files with 115 additions and 375 deletions

View File

@@ -168,7 +168,6 @@ bool peer_start_channeld(struct channel *channel,
const u8 *funding_signed,
bool reconnected)
{
const tal_t *tmpctx = tal_tmpctx(channel);
u8 *msg, *initmsg;
int hsmfd;
struct added_htlc *htlcs;
@@ -209,7 +208,6 @@ bool peer_start_channeld(struct channel *channel,
log_unusual(channel->log, "Could not subdaemon channel: %s",
strerror(errno));
channel_fail_transient(channel, "Failed to subdaemon channel");
tal_free(tmpctx);
return true;
}
@@ -281,6 +279,5 @@ bool peer_start_channeld(struct channel *channel,
/* We don't expect a response: we are triggered by funding_depth_cb. */
subd_send_msg(channel->owner, take(initmsg));
tal_free(tmpctx);
return true;
}