| 1590 | |
| 1591 | |
| 1592 | static struct command_result * |
| 1593 | payment_addgossip_success(struct command *cmd, |
| 1594 | const char *method, |
| 1595 | const char *buffer, |
| 1596 | const jsmntok_t *toks, struct payment *p) |
| 1597 | { |
| 1598 | const struct node_id *errnode; |
| 1599 | const struct route_hop *errchan; |
| 1600 | |
| 1601 | if (!assign_blame(p, &errnode, &errchan)) { |
| 1602 | paymod_log(p, LOG_UNUSUAL, |
| 1603 | "No erring_index set in `waitsendpay` result: %.*s", |
| 1604 | json_tok_full_len(toks), |
| 1605 | json_tok_full(buffer, toks)); |
| 1606 | /* FIXME: Pick a random channel to fail? */ |
| 1607 | payment_set_step(p, PAYMENT_STEP_FAILED); |
| 1608 | return payment_continue(p); |
| 1609 | } |
| 1610 | |
| 1611 | if (!errchan) |
| 1612 | return handle_final_failure(cmd, p, errnode, |
| 1613 | p->result->failcode); |
| 1614 | |
| 1615 | return handle_intermediate_failure(cmd, p, errnode, errchan, |
| 1616 | p->result->failcode); |
| 1617 | } |
| 1618 | |
| 1619 | /* If someone gives us an invalid update, all we can do is log it */ |
| 1620 | static struct command_result * |
no test coverage detected