| 25 | } |
| 26 | |
| 27 | u32 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 | |
| 47 | void start_height_update(struct height_states *height_states, |
| 48 | enum side opener, |
no test coverage detected