| 425 | */ |
| 426 | |
| 427 | static 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 | |
| 452 | REGISTER_PAYMENT_MODIFIER(refreshgossmap, refreshgossmap_cb); |
| 453 |
nothing calls this directly
no test coverage detected