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

Function get_blockheight

common/blockheight_states.c:26–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26u32 get_blockheight(const struct height_states *height_states,
27 enum side opener,
28 enum side side)
29{
30 /* The first non-NULL blockheight committed to this side is current */
31 /* We use the same states as update_fee */
32 for (enum htlc_state i = first_fee_state(opener);
33 i <= last_fee_state(opener);
34 i++) {
35 if (!height_states->height[i])
36 continue;
37 if (!(htlc_state_flags(i) & HTLC_FLAG(side, HTLC_F_COMMITTED)))
38 continue;
39 return *height_states->height[i];
40 }
41
42 /* Some blockheight should always be set! */
43 abort();
44}
45
46void start_height_update(struct height_states *height_states,
47 enum side opener,

Callers 9

want_blockheight_updateFunction · 0.85
handle_blockheightFunction · 0.85
peer_restart_dualopendFunction · 0.85
peer_got_commitsigFunction · 0.85
try_update_blockheightFunction · 0.85
peer_start_channeldFunction · 0.85
initial_channel_txFunction · 0.85
channel_blockheightFunction · 0.85

Calls 4

first_fee_stateFunction · 0.85
last_fee_stateFunction · 0.85
abortFunction · 0.85
htlc_state_flagsFunction · 0.70

Tested by

no test coverage detected