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

Function list_chain_fees_timebox

plugins/bkpr/onchain_fee.c:246–267  ·  view source on GitHub ↗

FIXME: slow */

Source from the content-addressed store, hash-verified

244
245/* FIXME: slow */
246struct onchain_fee **list_chain_fees_timebox(const tal_t *ctx,
247 const struct bkpr *bkpr,
248 u64 start_time, u64 end_time)
249{
250 struct onchain_fee **ret = tal_arr(ctx, struct onchain_fee *, 0);
251 struct ofees_hash_iter it;
252 struct ordered_ofees *ofees;
253
254 for (ofees = ofees_hash_first(bkpr->onchain_fees->by_account, &it);
255 ofees;
256 ofees = ofees_hash_next(bkpr->onchain_fees->by_account, &it)) {
257 for (size_t i = 0; i < tal_count(ofees->ofs); i++) {
258 if (ofees->ofs[i]->timestamp <= start_time)
259 continue;
260 if (ofees->ofs[i]->timestamp > end_time)
261 continue;
262 tal_arr_expand(&ret, ofees->ofs[i]);
263 }
264 }
265 order_fees(ret);
266 return ret;
267}
268
269struct onchain_fee **list_chain_fees(const tal_t *ctx, const struct bkpr *bkpr)
270{

Callers 3

list_chain_feesFunction · 0.85
list_income_eventsFunction · 0.85

Calls 1

order_feesFunction · 0.85

Tested by

no test coverage detected