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

Function route_exclusions_step_cb

plugins/libplugin-pay.c:3921–3945  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3919}
3920
3921static void route_exclusions_step_cb(struct route_exclusions_data *d,
3922 struct payment *p)
3923{
3924 if (p->parent)
3925 return payment_continue(p);
3926 struct route_exclusion **exclusions = d->exclusions;
3927 for (size_t i = 0; i < tal_count(exclusions); i++) {
3928 struct route_exclusion *e = exclusions[i];
3929 if (e->type == EXCLUDE_CHANNEL) {
3930 channel_hints_update(p, e->u.chan_id.scid, e->u.chan_id.dir,
3931 false, false, NULL, NULL);
3932 } else {
3933 if (node_id_eq(&e->u.node_id, p->destination)) {
3934 payment_abort(p, "Payee is manually excluded");
3935 return;
3936 } else if (node_id_eq(&e->u.node_id, p->local_id)) {
3937 payment_abort(p, "Payer is manually excluded");
3938 return;
3939 }
3940
3941 tal_arr_expand(&p->excluded_nodes, e->u.node_id);
3942 }
3943 }
3944 payment_continue(p);
3945}
3946
3947REGISTER_PAYMENT_MODIFIER(route_exclusions, struct route_exclusions_data *,
3948 route_exclusions_data_init, route_exclusions_step_cb);

Callers

nothing calls this directly

Calls 4

payment_continueFunction · 0.85
channel_hints_updateFunction · 0.85
node_id_eqFunction · 0.85
payment_abortFunction · 0.85

Tested by

no test coverage detected