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

Method send_pay

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

Source from the content-addressed store, hash-verified

123}
124
125async fn send_pay(
126 &self,
127 request: tonic::Request<pb::SendpayRequest>,
128) -> Result<tonic::Response<pb::SendpayResponse>, tonic::Status> {
129 let req = request.into_inner();
130 let req: requests::SendpayRequest = req.into();
131 debug!("Client asked for send_pay");
132 trace!("send_pay request: {:?}", req);
133 let mut rpc = ClnRpc::new(&self.rpc_path)
134 .await
135 .map_err(|e| Status::new(Code::Internal, e.to_string()))?;
136 let result = rpc.call(Request::SendPay(req))
137 .await
138 .map_err(|e| Status::new(
139 Code::Unknown,
140 format!("Error calling method SendPay: {:?}", e)))?;
141 match result {
142 Response::SendPay(r) => {
143 trace!("send_pay response: {:?}", r);
144 Ok(tonic::Response::new(r.into()))
145 },
146 r => Err(Status::new(
147 Code::Internal,
148 format!(
149 "Unexpected result {:?} to method call SendPay",
150 r
151 )
152 )),
153 }
154
155}
156
157async fn list_channels(
158 &self,

Callers

nothing calls this directly

Calls 2

to_stringMethod · 0.80
callMethod · 0.45

Tested by

no test coverage detected