pay: Add channel_hint_set_count primitive

This commit is contained in:
Christian Decker
2024-08-23 14:55:28 +02:00
parent 30a2933a94
commit 91ffa8e424
3 changed files with 10 additions and 4 deletions

View File

@@ -205,3 +205,8 @@ void channel_hint_set_update(struct channel_hint_set *set,
for (size_t i = 0; i < tal_count(set->hints); i++)
channel_hint_update(time_now(), &set->hints[i]);
}
size_t channel_hint_set_count(const struct channel_hint_set *set)
{
return tal_count(set->hints);
}

View File

@@ -87,4 +87,9 @@ struct channel_hint *channel_hint_set_add(struct channel_hint_set *self,
const struct amount_sat overall_capacity,
u16 *htlc_budget);
/**
* Count how many channel_hints the set contains.
*/
size_t channel_hint_set_count(const struct channel_hint_set *set);
#endif /* LIGHTNING_PLUGINS_CHANNEL_HINT_H */

View File

@@ -160,10 +160,6 @@ struct payment *payment_new(tal_t *ctx, struct command *cmd,
tal_arr_expand(&p->modifier_data, NULL);
}
paymod_log(p, LOG_DBG,
"Initialized a new (sub-)payment with %zu channel_hints",
tal_count(payment_root(p)->hints->hints));
return p;
}