| 1259 | } |
| 1260 | |
| 1261 | static 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 | |
| 1285 | bool routing_add_channel_update(struct routing_state *rstate, |
| 1286 | const u8 *update TAKES, |
no test coverage detected