| 106 | } |
| 107 | |
| 108 | static void tal_report_error(const tal_t *ctx, enum jsonrpc_errcode *ecode, |
| 109 | const char **fail, |
| 110 | enum jsonrpc_errcode error_value, const char *fmt, |
| 111 | ...) |
| 112 | { |
| 113 | tal_t *this_ctx = tal(ctx, tal_t); |
| 114 | |
| 115 | va_list ap; |
| 116 | const char *str; |
| 117 | |
| 118 | va_start(ap, fmt); |
| 119 | str = tal_vfmt(this_ctx, fmt, ap); |
| 120 | va_end(ap); |
| 121 | |
| 122 | if (ecode) |
| 123 | *ecode = error_value; |
| 124 | |
| 125 | if (fail) |
| 126 | *fail = tal_fmt(ctx, "%s", str); |
| 127 | |
| 128 | this_ctx = tal_free(this_ctx); |
| 129 | } |
| 130 | |
| 131 | /* Routes are computed and saved in the payment for later use. */ |
| 132 | struct route **get_routes(const tal_t *ctx, |
no test coverage detected