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

Function find_consolidated_fees

plugins/bkpr/incomestmt.c:270–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270static struct onchain_fee **find_consolidated_fees(const tal_t *ctx,
271 const struct bkpr *bkpr,
272 u64 start_time,
273 u64 end_time)
274{
275 struct fee_sum **sums;
276 struct onchain_fee **fee_sums
277 = tal_arr(ctx, struct onchain_fee *, 0);
278
279 sums = calculate_onchain_fee_sums(ctx, bkpr, start_time, end_time);
280
281 for (size_t i = 0; i < tal_count(sums); i++) {
282 /* Find the last matching feerate's data */
283 struct onchain_fee *fee;
284
285 if (amount_msat_is_zero(sums[i]->fees_paid))
286 continue;
287
288 fee = tal(fee_sums, struct onchain_fee);
289 fee->credit = sums[i]->fees_paid;
290 fee->debit = AMOUNT_MSAT(0);
291 fee->acct_name = tal_steal(fee, sums[i]->acct_name);
292 fee->txid = *sums[i]->txid;
293 fee->timestamp = sums[i]->last_timestamp;
294 tal_arr_expand(&fee_sums, fee);
295 }
296
297 tal_free(sums);
298 return fee_sums;
299}
300
301struct income_event **list_income_events(const tal_t *ctx,
302 const struct bkpr *bkpr,

Callers 1

list_income_eventsFunction · 0.85

Calls 3

amount_msat_is_zeroFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected