| 205 | } |
| 206 | |
| 207 | void json_sendpay_fail_fields(struct json_stream *js, |
| 208 | const struct wallet_payment *payment, |
| 209 | enum jsonrpc_errcode pay_errcode, |
| 210 | const struct onionreply *onionreply, |
| 211 | const struct routing_failure *fail) |
| 212 | { |
| 213 | /* "immediate_routing_failure" is before payment creation. */ |
| 214 | if (payment) |
| 215 | json_add_payment_fields(js, payment); |
| 216 | if (pay_errcode == PAY_UNPARSEABLE_ONION && onionreply) |
| 217 | json_add_hex_talarr(js, "onionreply", onionreply->contents); |
| 218 | else if (fail) |
| 219 | json_add_routefail_info(js, |
| 220 | fail->erring_index, |
| 221 | fail->failcode, |
| 222 | fail->erring_node, |
| 223 | fail->erring_channel, |
| 224 | fail->channel_dir, |
| 225 | fail->msg); |
| 226 | } |
| 227 | |
| 228 | static const char *sendpay_errmsg_fmt(const tal_t *ctx, enum jsonrpc_errcode pay_errcode, |
| 229 | const struct routing_failure *fail, |
no test coverage detected