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

Function update_pending

gossipd/routing.c:1261–1283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1259}
1260
1261static void update_pending(struct pending_cannouncement *pending,
1262 u32 timestamp, const u8 *update,
1263 const u8 direction,
1264 struct peer *peer)
1265{
1266 SUPERVERBOSE("Deferring update for pending channel %s/%d",
1267 type_to_string(tmpctx, struct short_channel_id,
1268 &pending->short_channel_id), direction);
1269
1270 if (pending->update_timestamps[direction] < timestamp) {
1271 if (pending->updates[direction]) {
1272 status_peer_debug(peer ? &peer->id : NULL,
1273 "Replacing existing update");
1274 tal_free(pending->updates[direction]);
1275 }
1276 pending->updates[direction]
1277 = tal_dup_talarr(pending, u8, update);
1278 pending->update_timestamps[direction] = timestamp;
1279 clear_softref(pending, &pending->update_peer_softref[direction]);
1280 set_softref(pending, &pending->update_peer_softref[direction],
1281 peer);
1282 }
1283}
1284
1285bool routing_add_channel_update(struct routing_state *rstate,
1286 const u8 *update TAKES,

Callers 1

handle_channel_updateFunction · 0.85

Calls 2

tal_freeFunction · 0.85
type_to_stringClass · 0.50

Tested by

no test coverage detected