mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
libplugin: Expose the jsonrpc_request_sync method
This one was mostly used in libplugin, but not available outside. It is rather useful, so let's expose it.
This commit is contained in:
committed by
Alex Myers
parent
4a38e37b59
commit
29031c02ca
@@ -583,6 +583,14 @@ static const jsmntok_t *sync_req(const tal_t *ctx,
|
|||||||
return contents;
|
return contents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const jsmntok_t *jsonrpc_request_sync(const tal_t *ctx, struct plugin *plugin,
|
||||||
|
const char *method,
|
||||||
|
const struct json_out *params TAKES,
|
||||||
|
const char **resp)
|
||||||
|
{
|
||||||
|
return sync_req(ctx, plugin, method, params, resp);
|
||||||
|
}
|
||||||
|
|
||||||
/* Returns contents of scanning guide on 'result' */
|
/* Returns contents of scanning guide on 'result' */
|
||||||
static const char *rpc_scan_core(const tal_t *ctx,
|
static const char *rpc_scan_core(const tal_t *ctx,
|
||||||
struct plugin *plugin,
|
struct plugin *plugin,
|
||||||
|
|||||||
@@ -478,4 +478,11 @@ void plugin_set_memleak_handler(struct plugin *plugin,
|
|||||||
struct htable *memtable));
|
struct htable *memtable));
|
||||||
#endif /* DEVELOPER */
|
#endif /* DEVELOPER */
|
||||||
|
|
||||||
|
/* Synchronously call a JSON-RPC method and return its contents and
|
||||||
|
* the parser token. */
|
||||||
|
const jsmntok_t *jsonrpc_request_sync(const tal_t *ctx, struct plugin *plugin,
|
||||||
|
const char *method,
|
||||||
|
const struct json_out *params TAKES,
|
||||||
|
const char **resp);
|
||||||
|
|
||||||
#endif /* LIGHTNING_PLUGINS_LIBPLUGIN_H */
|
#endif /* LIGHTNING_PLUGINS_LIBPLUGIN_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user