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

Function sendpay_fail

lightningd/pay.c:244–263  ·  view source on GitHub ↗

onionreply used if pay_errcode == PAY_UNPARSEABLE_ONION */

Source from the content-addressed store, hash-verified

242
243/* onionreply used if pay_errcode == PAY_UNPARSEABLE_ONION */
244static struct command_result *
245sendpay_fail(struct command *cmd,
246 const struct wallet_payment *payment,
247 enum jsonrpc_errcode pay_errcode,
248 const struct onionreply *onionreply,
249 const struct routing_failure *fail,
250 const char *errmsg)
251{
252 struct json_stream *data;
253
254 data = json_stream_fail(cmd, pay_errcode,
255 errmsg);
256 json_sendpay_fail_fields(data,
257 payment,
258 pay_errcode,
259 onionreply,
260 fail);
261 json_object_end(data);
262 return command_failed(cmd, data);
263}
264
265/* We defer sendpay "success" until we know it's pending; consumes cmd */
266static struct command_result *

Callers 3

tell_waiters_failedFunction · 0.85
wait_paymentFunction · 0.85
send_payment_coreFunction · 0.85

Calls 4

json_sendpay_fail_fieldsFunction · 0.85
json_stream_failFunction · 0.70
command_failedFunction · 0.70
json_object_endFunction · 0.50

Tested by

no test coverage detected