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

Function get_blockheight

common/blockheight_states.c:27–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 8

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

Calls 4

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

Tested by

no test coverage detected