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

Function force_node_announce_rexmit

gossipd/routing.c:438–469  ·  view source on GitHub ↗

Move this node's announcement to the tail of the gossip_store, to * make everyone send it again. */

Source from the content-addressed store, hash-verified

436/* Move this node's announcement to the tail of the gossip_store, to
437 * make everyone send it again. */
438static void force_node_announce_rexmit(struct routing_state *rstate,
439 struct node *node)
440{
441 const u8 *announce;
442 bool is_local = node_id_eq(&node->id, &rstate->local_id);
443 announce = gossip_store_get(tmpctx, rstate->gs, node->bcast.index);
444
445 u32 initial_bcast_index = node->bcast.index;
446 gossip_store_delete(rstate->gs,
447 &node->bcast,
448 WIRE_NODE_ANNOUNCEMENT);
449 node->bcast.index = gossip_store_add(rstate->gs,
450 announce,
451 node->bcast.timestamp,
452 is_local,
453 false,
454 NULL);
455 if (node->rgraph.index == initial_bcast_index){
456 node->rgraph.index = node->bcast.index;
457 } else {
458 announce = gossip_store_get(tmpctx, rstate->gs, node->rgraph.index);
459 gossip_store_delete(rstate->gs,
460 &node->rgraph,
461 WIRE_NODE_ANNOUNCEMENT);
462 node->rgraph.index = gossip_store_add(rstate->gs,
463 announce,
464 node->rgraph.timestamp,
465 is_local,
466 false,
467 NULL);
468 }
469}
470
471static void remove_chan_from_node(struct routing_state *rstate,
472 struct node *node, const struct chan *chan)

Callers 1

remove_chan_from_nodeFunction · 0.85

Calls 4

node_id_eqFunction · 0.85
gossip_store_getFunction · 0.70
gossip_store_deleteFunction · 0.70
gossip_store_addFunction · 0.70

Tested by

no test coverage detected