mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
cda8f8190b
This turned into a more extensive cleanup than intended. The previous warnings were overlapping and confusing, especially now MPP is the norm. *warning_capacity* is now the "even under best circumstances, we don't have enough incoming capacity", which is really what warning_mpp_capacity was trying to say (no longer printed). *warning_offline* and *warning_deadends* are only given if adding such peers would have helped give capacity (i.e. not if *warning_capacity* is set). The new *warning_private_unused* tells you that we would have sufficient capacity, but we refused to expose private channels. The test cases have been enhanced to cover the new warnings. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Added: JSON-RPC: `invoice` now gives `warning_private_unused` if unused unannounced channels could have provided sufficient capacity. Changelog-Changed: JSON-RPC: `invoice` warnings are now better defined, and `warning_mpp_capacity` is no longer included (since `warning_capacity` covers that).
46 lines
1.5 KiB
C
46 lines
1.5 KiB
C
/* Code for routehints to be inserted into invoices and offers */
|
|
#ifndef LIGHTNING_LIGHTNINGD_ROUTEHINT_H
|
|
#define LIGHTNING_LIGHTNINGD_ROUTEHINT_H
|
|
#include "config.h"
|
|
#include <ccan/short_types/short_types.h>
|
|
#include <ccan/tal/tal.h>
|
|
#include <common/amount.h>
|
|
#include <stdbool.h>
|
|
|
|
struct lightningd;
|
|
struct short_channel_id;
|
|
|
|
struct routehint_candidate {
|
|
struct route_info *r;
|
|
struct channel *c;
|
|
struct amount_msat capacity;
|
|
};
|
|
|
|
/**
|
|
* routehint_candidates - get possible incoming channels for routehinting.
|
|
* @ctx: tal context to allocate return off
|
|
* @ld: lightningd
|
|
* @buf, @toks: output of listincoming command
|
|
* @expose_all_private: trinary. NULL=iff no public, true=always, false=never.
|
|
* @hints: only consider these channels (if !expose_all_private).
|
|
* @none_public: set to true if we used private channels because none were public.
|
|
* @avail_capacity: total capacity of usable channels.
|
|
* @private_capacity: total capacity of unused private channels.
|
|
* @deadend_capacity: total capacity of "deadend" channels.
|
|
* @offline_capacity: total capacity of offline channels.
|
|
*/
|
|
struct routehint_candidate *
|
|
routehint_candidates(const tal_t *ctx,
|
|
struct lightningd *ld,
|
|
const char *buf,
|
|
const jsmntok_t *toks,
|
|
const bool *expose_all_private,
|
|
const struct short_channel_id *hints,
|
|
bool *none_public,
|
|
struct amount_msat *avail_capacity,
|
|
struct amount_msat *private_capacity,
|
|
struct amount_msat *deadend_capacity,
|
|
struct amount_msat *offline_capacity);
|
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_ROUTEHINT_H */
|