plugin: Tell the plugin which network we run on

The fundchannel plugin needs to know how to build a transaction, so we need to
tell it which chainparams to use. Also adds `chainparams` as a global, since
that seems to be the way to do things in plugins.
This commit is contained in:
Christian Decker
2019-09-17 13:03:11 +02:00
committed by Rusty Russell
parent 858b3f2b93
commit 14247283b2
3 changed files with 20 additions and 8 deletions

View File

@@ -1049,6 +1049,9 @@ plugin_populate_init_request(struct plugin *plugin, struct jsonrpc_request *req)
json_add_string(req->stream, "lightning-dir", ld->config_dir);
json_add_string(req->stream, "rpc-file", ld->rpc_filename);
json_add_bool(req->stream, "startup", plugin->plugins->startup);
json_add_string(
req->stream, "network",
plugin->plugins->ld->topology->bitcoind->chainparams->network_name);
json_object_end(req->stream);
}