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

Function write_bidir_perchan

devtools/gossmap-compress.c:197–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197static void write_bidir_perchan(gzFile outf,
198 struct gossmap *gossmap,
199 struct gossmap_chan **chans,
200 u64 (*get_value)(struct gossmap *,
201 const struct gossmap_chan *,
202 int),
203 const char *what)
204{
205 u64 *vals = tal_arr(tmpctx, u64, tal_count(chans) * 2);
206
207 for (size_t i = 0; i < tal_count(chans); i++) {
208 for (size_t dir = 0; dir < 2; dir++) {
209 if (chans[i]->half[dir].enabled)
210 vals[i*2+dir] = get_value(gossmap, chans[i], dir);
211 else
212 vals[i*2+dir] = 0;
213 }
214 }
215
216 write_template_and_values(outf, vals, what);
217}
218
219static u64 get_htlc_min(struct gossmap *gossmap,
220 const struct gossmap_chan *chan,

Callers 1

mainFunction · 0.85

Calls 1

Tested by

no test coverage detected