onionreply used if pay_errcode == PAY_UNPARSEABLE_ONION */
| 269 | |
| 270 | /* onionreply used if pay_errcode == PAY_UNPARSEABLE_ONION */ |
| 271 | static struct command_result * |
| 272 | sendpay_fail(struct command *cmd, |
| 273 | const struct wallet_payment *payment, |
| 274 | enum jsonrpc_errcode pay_errcode, |
| 275 | const struct onionreply *onionreply, |
| 276 | const struct routing_failure *fail, |
| 277 | const char *errmsg, |
| 278 | void *unused) |
| 279 | { |
| 280 | struct json_stream *data; |
| 281 | |
| 282 | data = json_stream_fail(cmd, pay_errcode, |
| 283 | errmsg); |
| 284 | json_sendpay_fail_fields(data, |
| 285 | payment, |
| 286 | pay_errcode, |
| 287 | onionreply, |
| 288 | fail); |
| 289 | json_object_end(data); |
| 290 | return command_failed(cmd, data); |
| 291 | } |
| 292 | |
| 293 | /* We defer sendpay "success" until we know it's pending; consumes cmd */ |
| 294 | static struct command_result * |
no test coverage detected