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

Function towire_height_states

common/blockheight_states.c:118–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118void towire_height_states(u8 **pptr, const struct height_states *states)
119{
120 for (enum htlc_state i = 0; i < ARRAY_SIZE(states->height); i++) {
121 /* We don't send uncommitted feestates */
122 if (!(htlc_state_flags(i) & (HTLC_REMOTE_F_COMMITTED
123 | HTLC_LOCAL_F_COMMITTED))
124 || states->height[i] == NULL) {
125 towire_bool(pptr, false);
126 continue;
127 }
128 towire_bool(pptr, true);
129 towire_u32(pptr, *states->height[i]);
130 }
131}
132
133struct height_states *fromwire_height_states(const tal_t *ctx, const u8 **cursor, size_t *max)
134{

Callers

nothing calls this directly

Calls 3

htlc_state_flagsFunction · 0.70
towire_boolFunction · 0.50
towire_u32Function · 0.50

Tested by

no test coverage detected