MCPcopy Create free account
hub / github.com/ElementsProject/lightning / add_gossip

Method add_gossip

cln-grpc/src/server.rs:189–219  ·  view source on GitHub ↗
(
    &self,
    request: tonic::Request<pb::AddgossipRequest>,
)

Source from the content-addressed store, hash-verified

187}
188
189async fn add_gossip(
190 &self,
191 request: tonic::Request<pb::AddgossipRequest>,
192) -> Result<tonic::Response<pb::AddgossipResponse>, tonic::Status> {
193 let req = request.into_inner();
194 let req: requests::AddgossipRequest = req.into();
195 debug!("Client asked for add_gossip");
196 trace!("add_gossip request: {:?}", req);
197 let mut rpc = ClnRpc::new(&self.rpc_path)
198 .await
199 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
200 let result = rpc.call(Request::AddGossip(req))
201 .await
202 .map_err(|e| Status::new(
203 Code::Unknown,
204 format!("Error calling method AddGossip: {:?}", e)))?;
205 match result {
206 Response::AddGossip(r) => {
207 trace!("add_gossip response: {:?}", r);
208 Ok(tonic::Response::new(r.into()))
209 },
210 r => Err(Status::new(
211 Code::Internal,
212 format!(
213 "Unexpected result {:?} to method call AddGossip",
214 r
215 )
216 )),
217 }
218
219}
220
221async fn auto_clean_invoice(
222 &self,

Callers

nothing calls this directly

Calls 2

to_stringMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected