| 765 | } |
| 766 | |
| 767 | static void process_pending_node_announcement(struct routing_state *rstate, |
| 768 | struct node_id *nodeid) |
| 769 | { |
| 770 | struct pending_node_announce *pna = pending_node_map_get(rstate->pending_node_map, nodeid); |
| 771 | if (!pna) |
| 772 | return; |
| 773 | |
| 774 | if (pna->node_announcement) { |
| 775 | SUPERVERBOSE( |
| 776 | "Processing deferred node_announcement for node %s", |
| 777 | type_to_string(pna, struct node_id, nodeid)); |
| 778 | |
| 779 | /* Can fail it timestamp is now too old */ |
| 780 | if (!routing_add_node_announcement(rstate, |
| 781 | pna->node_announcement, |
| 782 | pna->index, |
| 783 | pna->peer_softref, NULL, |
| 784 | false)) |
| 785 | status_unusual("pending node_announcement %s too old?", |
| 786 | tal_hex(tmpctx, pna->node_announcement)); |
| 787 | /* Never send this again. */ |
| 788 | pna->node_announcement = tal_free(pna->node_announcement); |
| 789 | } |
| 790 | |
| 791 | /* We don't need to catch any more node_announcements, since we've |
| 792 | * accepted the public channel now. But other pending announcements |
| 793 | * may still hold a reference they use in |
| 794 | * del_pending_node_announcement, so simply delete it from the map. */ |
| 795 | pending_node_map_del(rstate->pending_node_map, notleak(pna)); |
| 796 | } |
| 797 | |
| 798 | static struct pending_cannouncement * |
| 799 | find_pending_cannouncement(struct routing_state *rstate, |
no test coverage detected