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

Function want_blockheight_update

channeld/channeld.c:1189–1221  ·  view source on GitHub ↗

Do we want to update blockheight? */

Source from the content-addressed store, hash-verified

1187
1188/* Do we want to update blockheight? */
1189static 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
1223static void send_commit(struct peer *peer)
1224{

Callers 1

send_commitFunction · 0.85

Calls 1

get_blockheightFunction · 0.85

Tested by

no test coverage detected