jsonrpc: populate ld->jsonrpc ourselves, so we can use it.

Next patch will call commands to get usage inside jsonrpc_new(): to do
this it will need access to ld->jsonrpc, so we can't use the current
pattern.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-02-04 21:25:42 +10:30
parent cc76416447
commit dabdefefae
4 changed files with 15 additions and 12 deletions

View File

@@ -8,6 +8,8 @@
#include <lightningd/json_stream.h>
#include <stdarg.h>
struct jsonrpc;
/* The command mode tells param() how to process. */
enum command_mode {
/* Normal command processing */
@@ -152,8 +154,10 @@ struct command_result *command_its_complicated(const char *why);
* This doesn't setup the listener yet, see `jsonrpc_listen` for
* that. This just creates the container for all jsonrpc-related
* information so we can start gathering it before actually starting.
*
* It initializes ld->jsonrpc.
*/
struct jsonrpc *jsonrpc_new(const tal_t *ctx, struct lightningd *ld);
void jsonrpc_setup(struct lightningd *ld);
/**