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

Function new_height_states

common/blockheight_states.c:10–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include <wire/wire.h>
9
10struct height_states *new_height_states(const tal_t *ctx,
11 enum side opener,
12 const u32 *blockheight)
13{
14 struct height_states *states = tal(ctx, struct height_states);
15
16 /* Set to NULL except terminal value */
17 for (size_t i = 0; i < ARRAY_SIZE(states->height); i++)
18 states->height[i] = NULL;
19
20 if (blockheight)
21 /* We reuse fee states! */
22 states->height[last_fee_state(opener)]
23 = tal_dup(states, u32, blockheight);
24 return states;
25}
26
27u32 get_blockheight(const struct height_states *height_states,
28 enum side opener,

Callers 10

test_channel_crudFunction · 0.50
mainFunction · 0.50
runFunction · 0.50
revert_channel_stateFunction · 0.50
accepter_commitsFunction · 0.50
opener_commitsFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50

Calls 1

last_fee_stateFunction · 0.70

Tested by 3

test_channel_crudFunction · 0.40
mainFunction · 0.40