Files
palladum-lightning/plugins/askrene/askrene.h
Rusty Russell 3c6504a99e askrene: limit how many children we have.
Queue them before we query local channels, so they don't use stale
information.

Changelog-Added: Config: `askrene-max-threads` to control how many CPUs we use for routing (default 4).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2026-02-19 17:04:35 +10:30

47 lines
1.3 KiB
C

#ifndef LIGHTNING_PLUGINS_ASKRENE_ASKRENE_H
#define LIGHTNING_PLUGINS_ASKRENE_ASKRENE_H
#include "config.h"
#include <bitcoin/short_channel_id.h>
#include <ccan/bitmap/bitmap.h>
#include <ccan/htable/htable_type.h>
#include <ccan/list/list.h>
#include <common/amount.h>
#include <common/fp16.h>
#include <common/node_id.h>
#include <plugins/libplugin.h>
struct gossmap_chan;
/* Grab-bag of "globals" for this plugin */
struct askrene {
struct plugin *plugin;
struct gossmap *gossmap;
/* Hash table of layers by name */
struct layer_name_hash *layers;
/* In-flight payment attempts */
struct reserve_htable *reserved;
/* Compact cache of gossmap capacities */
fp16_t *capacities;
/* My own id */
struct node_id my_id;
/* Aux command for layer */
struct command *layer_cmd;
/* How long before we abort trying to find a route? */
u32 route_seconds;
/* Maximum number of routing children */
u32 max_children;
/* How many requests live now? */
size_t num_live_requests;
/* Routing children currently in flight. */
struct list_head children;
/* Ones waiting */
struct list_head waiters;
};
/* Useful plugin->askrene mapping */
static inline struct askrene *get_askrene(struct plugin *plugin)
{
return plugin_get_data(plugin, struct askrene);
}
#endif /* LIGHTNING_PLUGINS_ASKRENE_ASKRENE_H */