| 836 | } |
| 837 | |
| 838 | static 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 | |
| 866 | static void remove_channel_from_store(struct routing_state *rstate, |
| 867 | struct chan *chan) |
no test coverage detected