cln-grpc: Patches rpc-file path

`cln-gprc` is assuming the `rpc-file` path is set as default, which may not always
be the case. Set the path the what the plugin manager reports
This commit is contained in:
Sergi Delgado Segura 2023-11-03 15:59:10 -04:00 committed by Christian Decker
parent fe09484bb9
commit 23bd03c62b

View file

@ -3,7 +3,7 @@ use cln_grpc::pb::node_server::NodeServer;
use cln_plugin::{options, Builder};
use log::{debug, warn};
use std::net::SocketAddr;
use std::path::{Path, PathBuf};
use std::path::PathBuf;
mod tls;
@ -17,7 +17,6 @@ struct PluginState {
#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<()> {
debug!("Starting grpc plugin");
let path = Path::new("lightning-rpc");
let directory = std::env::current_dir()?;
@ -50,7 +49,7 @@ async fn main() -> Result<()> {
let (identity, ca_cert) = tls::init(&directory)?;
let state = PluginState {
rpc_path: path.into(),
rpc_path: PathBuf::from(plugin.configuration().rpc_file.as_str()),
identity,
ca_cert,
};