Generic handler for RPC failures that should end up failing the payment. */
| 74 | |
| 75 | /* Generic handler for RPC failures that should end up failing the payment. */ |
| 76 | static struct command_result *payment_rpc_failure(struct command *cmd, |
| 77 | const char *method UNUSED, |
| 78 | const char *buffer, |
| 79 | const jsmntok_t *toks, |
| 80 | struct payment *payment) |
| 81 | { |
| 82 | const jsmntok_t *codetok = json_get_member(buffer, toks, "code"); |
| 83 | u32 errcode; |
| 84 | if (codetok != NULL) |
| 85 | json_to_u32(buffer, codetok, &errcode); |
| 86 | else |
| 87 | errcode = LIGHTNINGD; |
| 88 | |
| 89 | return payment_fail( |
| 90 | payment, errcode, |
| 91 | "Failing a partial payment due to a failed RPC call: %.*s", |
| 92 | json_tok_full_len(toks), json_tok_full(buffer, toks)); |
| 93 | } |
| 94 | |
| 95 | static void add_hintchan(struct payment *payment, const struct node_id *src, |
| 96 | const struct node_id *dst, u16 cltv_expiry_delta, |
nothing calls this directly
no test coverage detected