| 1447 | |
| 1448 | |
| 1449 | static struct command_result * |
| 1450 | payment_addgossip_success(struct command *cmd, const char *buffer, |
| 1451 | const jsmntok_t *toks, struct payment *p) |
| 1452 | { |
| 1453 | const struct node_id *errnode; |
| 1454 | const struct route_hop *errchan; |
| 1455 | |
| 1456 | if (!assign_blame(p, &errnode, &errchan)) { |
| 1457 | paymod_log(p, LOG_UNUSUAL, |
| 1458 | "No erring_index set in `waitsendpay` result: %.*s", |
| 1459 | json_tok_full_len(toks), |
| 1460 | json_tok_full(buffer, toks)); |
| 1461 | /* FIXME: Pick a random channel to fail? */ |
| 1462 | payment_set_step(p, PAYMENT_STEP_FAILED); |
| 1463 | payment_continue(p); |
| 1464 | return command_still_pending(cmd); |
| 1465 | } |
| 1466 | |
| 1467 | if (!errchan) |
| 1468 | return handle_final_failure(cmd, p, errnode, |
| 1469 | p->result->failcode); |
| 1470 | |
| 1471 | return handle_intermediate_failure(cmd, p, errnode, errchan, |
| 1472 | p->result->failcode); |
| 1473 | } |
| 1474 | |
| 1475 | /* If someone gives us an invalid update, all we can do is log it */ |
| 1476 | static struct command_result * |
no test coverage detected