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

Function refreshgossmap_cb

plugins/renepay/mods.c:427–450  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425 */
426
427static struct command_result *refreshgossmap_cb(struct payment *payment)
428{
429 assert(pay_plugin->gossmap); // gossmap must be already initialized
430 assert(payment);
431 assert(payment->local_gossmods);
432
433 bool gossmap_changed = gossmap_refresh(pay_plugin->gossmap);
434
435 if (gossmap_changed) {
436 gossmap_apply_localmods(pay_plugin->gossmap,
437 payment->local_gossmods);
438 int skipped_count = uncertainty_update(pay_plugin->uncertainty,
439 pay_plugin->gossmap);
440 gossmap_remove_localmods(pay_plugin->gossmap,
441 payment->local_gossmods);
442 if (skipped_count)
443 plugin_log(
444 pay_plugin->plugin, LOG_UNUSUAL,
445 "%s: uncertainty was updated but %d channels have "
446 "been ignored.",
447 __func__, skipped_count);
448 }
449 return payment_continue(payment);
450}
451
452REGISTER_PAYMENT_MODIFIER(refreshgossmap, refreshgossmap_cb);
453

Callers

nothing calls this directly

Calls 6

gossmap_refreshFunction · 0.85
gossmap_apply_localmodsFunction · 0.85
uncertainty_updateFunction · 0.85
gossmap_remove_localmodsFunction · 0.85
payment_continueFunction · 0.70
plugin_logFunction · 0.50

Tested by

no test coverage detected