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

Function payment_addgossip_success

plugins/libplugin-pay.c:1449–1473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1447
1448
1449static struct command_result *
1450payment_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 */
1476static struct command_result *

Callers 2

Calls 9

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

Tested by

no test coverage detected