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

Function delete_chan_messages_from_store

gossipd/routing.c:838–864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

836}
837
838static void delete_chan_messages_from_store(struct routing_state *rstate,
839 struct chan *chan)
840{
841 int update_type, announcment_type;
842
843 if (is_chan_public(chan)) {
844 update_type = WIRE_CHANNEL_UPDATE;
845 announcment_type = WIRE_CHANNEL_ANNOUNCEMENT;
846 } else {
847 update_type = WIRE_GOSSIP_STORE_PRIVATE_UPDATE;
848 announcment_type = WIRE_GOSSIP_STORE_PRIVATE_CHANNEL;
849 }
850
851 /* If these aren't in the store, these are noops. */
852 gossip_store_delete(rstate->gs,
853 &chan->bcast, announcment_type);
854 if (chan->half[0].rgraph.index != chan->half[0].bcast.index)
855 gossip_store_delete(rstate->gs,
856 &chan->half[0].rgraph, update_type);
857 gossip_store_delete(rstate->gs,
858 &chan->half[0].bcast, update_type);
859 if (chan->half[1].rgraph.index != chan->half[1].bcast.index)
860 gossip_store_delete(rstate->gs,
861 &chan->half[1].rgraph, update_type);
862 gossip_store_delete(rstate->gs,
863 &chan->half[1].bcast, update_type);
864}
865
866static void remove_channel_from_store(struct routing_state *rstate,
867 struct chan *chan)

Callers 2

Calls 2

is_chan_publicFunction · 0.85
gossip_store_deleteFunction · 0.70

Tested by

no test coverage detected