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

Function tell_waiter

lightningd/invoice.c:98–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98static struct command_result *tell_waiter(struct command *cmd, u64 inv_dbid)
99{
100 struct json_stream *response;
101 const struct invoice_details *details;
102
103 details = invoices_get_details(cmd, cmd->ld->wallet->invoices, inv_dbid);
104 if (details->state == PAID) {
105 response = json_stream_success(cmd);
106 json_add_invoice_fields(response, details);
107 return command_success(cmd, response);
108 } else {
109 response = json_stream_fail(cmd, INVOICE_EXPIRED_DURING_WAIT,
110 "invoice expired during wait");
111 json_add_invoice_fields(response, details);
112 json_object_end(response);
113 return command_failed(cmd, response);
114 }
115}
116
117static void tell_waiter_deleted(struct command *cmd)
118{

Callers 2

wait_on_invoiceFunction · 0.85
json_waitinvoiceFunction · 0.85

Calls 7

json_object_endFunction · 0.85
json_stream_successFunction · 0.70
json_add_invoice_fieldsFunction · 0.70
command_successFunction · 0.70
json_stream_failFunction · 0.70
command_failedFunction · 0.70
invoices_get_detailsFunction · 0.50

Tested by

no test coverage detected