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

Function can_carry_onionmsg

plugins/fetchinvoice.c:542–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

540}
541
542static bool can_carry_onionmsg(const struct gossmap *map,
543 const struct gossmap_chan *c,
544 int dir,
545 struct amount_msat amount UNUSED,
546 void *arg UNUSED)
547{
548 const struct gossmap_node *n;
549 /* Don't use it if either side says it's disabled */
550 if (!c->half[dir].enabled || !c->half[!dir].enabled)
551 return false;
552
553 /* Check features of recipient */
554 n = gossmap_nth_node(map, c, !dir);
555 /* 102/103 was the old EXPERIMENTAL feature bit: remove soon! */
556 return gossmap_node_get_feature(map, n, OPT_ONION_MESSAGES) != -1
557 || gossmap_node_get_feature(map, n, 102) != -1;
558}
559
560enum nodeid_parity {
561 nodeid_parity_even = SECP256K1_TAG_PUBKEY_EVEN,

Callers

nothing calls this directly

Calls 2

gossmap_nth_nodeFunction · 0.85
gossmap_node_get_featureFunction · 0.85

Tested by

no test coverage detected