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

Method send_pay

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

Source from the content-addressed store, hash-verified

179 }
180
181 async fn send_pay(
182 &self,
183 request: tonic::Request<pb::SendpayRequest>,
184 ) -> Result<tonic::Response<pb::SendpayResponse>, tonic::Status> {
185 let req = request.into_inner();
186 let req: requests::SendpayRequest = req.into();
187 debug!("Client asked for send_pay");
188 trace!("send_pay request: {:?}", req);
189 let mut rpc = ClnRpc::new(&self.rpc_path)
190 .await
191 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
192 let result = rpc.call(Request::SendPay(req))
193 .await
194 .map_err(|e| Status::new(
195 Code::Unknown,
196 format!("Error calling method SendPay: {:?}", e)))?;
197 match result {
198 Response::SendPay(r) => {
199 trace!("send_pay response: {:?}", r);
200 Ok(tonic::Response::new(r.into()))
201 },
202 r => Err(Status::new(
203 Code::Internal,
204 format!(
205 "Unexpected result {:?} to method call SendPay",
206 r
207 )
208 )),
209 }
210
211 }
212
213 async fn list_channels(
214 &self,

Callers

nothing calls this directly

Calls 3

into_innerMethod · 0.80
to_stringMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected