Do we want to update blockheight? */
| 1187 | |
| 1188 | /* Do we want to update blockheight? */ |
| 1189 | static bool want_blockheight_update(const struct peer *peer, u32 *height) |
| 1190 | { |
| 1191 | u32 last; |
| 1192 | |
| 1193 | if (peer->channel->opener != LOCAL) |
| 1194 | return false; |
| 1195 | |
| 1196 | if (peer->channel->lease_expiry == 0) |
| 1197 | return false; |
| 1198 | |
| 1199 | #if EXPERIMENTAL_FEATURES |
| 1200 | /* No fee update while quiescing! */ |
| 1201 | if (peer->stfu) |
| 1202 | return false; |
| 1203 | #endif |
| 1204 | /* What's the current blockheight */ |
| 1205 | last = get_blockheight(peer->channel->blockheight_states, |
| 1206 | peer->channel->opener, LOCAL); |
| 1207 | |
| 1208 | if (peer->our_blockheight < last) { |
| 1209 | status_broken("current blockheight %u less than last %u", |
| 1210 | peer->our_blockheight, last); |
| 1211 | return false; |
| 1212 | } |
| 1213 | |
| 1214 | if (peer->our_blockheight == last) |
| 1215 | return false; |
| 1216 | |
| 1217 | if (height) |
| 1218 | *height = peer->our_blockheight; |
| 1219 | |
| 1220 | return true; |
| 1221 | } |
| 1222 | |
| 1223 | static void send_commit(struct peer *peer) |
| 1224 | { |
no test coverage detected