| 232 | } |
| 233 | |
| 234 | void json_sendpay_fail_fields(struct json_stream *js, |
| 235 | const struct wallet_payment *payment, |
| 236 | enum jsonrpc_errcode pay_errcode, |
| 237 | const struct onionreply *onionreply, |
| 238 | const struct routing_failure *fail) |
| 239 | { |
| 240 | /* "immediate_routing_failure" is before payment creation. */ |
| 241 | if (payment) |
| 242 | json_add_payment_fields(js, payment); |
| 243 | if (pay_errcode == PAY_UNPARSEABLE_ONION && onionreply) |
| 244 | json_add_hex_talarr(js, "onionreply", onionreply->contents); |
| 245 | else if (fail) |
| 246 | json_add_routefail_info(js, |
| 247 | fail->erring_index, |
| 248 | fail->failcode, |
| 249 | fail->erring_node, |
| 250 | fail->erring_channel, |
| 251 | fail->channel_dir, |
| 252 | fail->msg); |
| 253 | } |
| 254 | |
| 255 | static const char *sendpay_errmsg_fmt(const tal_t *ctx, enum jsonrpc_errcode pay_errcode, |
| 256 | const struct routing_failure *fail, |
no test coverage detected