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

Function fromwire_height_states

common/blockheight_states.c:132–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132struct height_states *fromwire_height_states(const tal_t *ctx, const u8 **cursor, size_t *max)
133{
134 struct height_states *states = tal(ctx, struct height_states);
135
136 for (enum htlc_state i = 0; i < ARRAY_SIZE(states->height); i++) {
137 if (fromwire_bool(cursor, max)) {
138 states->height[i] = tal(states, u32);
139 *states->height[i] = fromwire_u32(cursor, max);
140 } else {
141 states->height[i] = NULL;
142 }
143 }
144 if (!*cursor)
145 return tal_free(states);
146 return states;
147}
148
149char *fmt_height_states(const tal_t *ctx,
150 const struct height_states *states)

Callers

nothing calls this directly

Calls 3

tal_freeFunction · 0.85
fromwire_boolFunction · 0.50
fromwire_u32Function · 0.50

Tested by

no test coverage detected