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

Function can_carry_onionmsg

plugins/establish_onion_path.c:63–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63static bool can_carry_onionmsg(const struct gossmap *map,
64 const struct gossmap_chan *c,
65 int dir,
66 struct amount_msat amount UNUSED,
67 void *arg UNUSED)
68{
69 const struct gossmap_node *n;
70
71 /* Don't try to use disabled channels! */
72 if (!c->half[dir].enabled)
73 return false;
74
75 /* Our local additions are always fine, since we checked features then */
76 if (gossmap_chan_is_localmod(map, c))
77 return true;
78
79 /* Check features of recipient */
80 n = gossmap_nth_node(map, c, !dir);
81 return gossmap_node_get_feature(map, n, OPT_ONION_MESSAGES) != -1;
82}
83
84static void local_mods_remove_channels(struct gossmap_localmods *mods,
85 const struct gossmap *gossmap,

Callers

nothing calls this directly

Calls 3

gossmap_chan_is_localmodFunction · 0.85
gossmap_nth_nodeFunction · 0.85
gossmap_node_get_featureFunction · 0.85

Tested by

no test coverage detected