libplugin: include the rpc conn into the global state

And rename the struct name, as it's now only used for RPC.
This commit is contained in:
darosior
2020-01-27 00:42:00 +01:00
committed by Rusty Russell
parent 98e8aac75f
commit 499dce1c38
5 changed files with 116 additions and 117 deletions

View File

@@ -8,7 +8,7 @@
static u64 cycle_seconds = 0, expired_by = 86400;
static struct plugin_timer *cleantimer;
static struct plugin_conn *rpc;
static struct rpc_conn *rpc;
static struct command_result *do_clean(void);
@@ -65,10 +65,10 @@ static struct command_result *json_autocleaninvoice(struct command *cmd,
expired_by, cycle_seconds));
}
static void init(struct plugin_conn *prpc,
static void init(struct plugin *p,
const char *buf UNUSED, const jsmntok_t *config UNUSED)
{
rpc = prpc;
rpc = &p->rpc_conn;
if (cycle_seconds) {
plugin_log(LOG_INFORM, "autocleaning every %"PRIu64" seconds", cycle_seconds);