MCPcopy Create free account
hub / github.com/ElementsProject/lightning / payment_addgossip_success

Function payment_addgossip_success

plugins/libplugin-pay.c:1592–1617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1590
1591
1592static struct command_result *
1593payment_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 */
1620static struct command_result *

Callers 2

Calls 8

assign_blameFunction · 0.85
paymod_logFunction · 0.85
payment_set_stepFunction · 0.85
handle_final_failureFunction · 0.85
payment_continueFunction · 0.70
json_tok_full_lenFunction · 0.50
json_tok_fullFunction · 0.50

Tested by

no test coverage detected