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

Function fromwire_height_states

common/blockheight_states.c:133–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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