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

Function default_features

lightningd/lightningd.c:815–849  ·  view source on GitHub ↗

~ We actually keep more than one set of features, used in different * contexts. common/features.c knows how each standard feature is * presented, so we have it generate the set for each one at a time, and * combine them. * * This is inefficient, but the primitives are useful for adding single * features later, or adding them when supplied by plugins. */

Source from the content-addressed store, hash-verified

813 * This is inefficient, but the primitives are useful for adding single
814 * features later, or adding them when supplied by plugins. */
815static struct feature_set *default_features(const tal_t *ctx)
816{
817 struct feature_set *ret = NULL;
818 static const u32 features[] = {
819 OPTIONAL_FEATURE(OPT_DATA_LOSS_PROTECT),
820 OPTIONAL_FEATURE(OPT_UPFRONT_SHUTDOWN_SCRIPT),
821 OPTIONAL_FEATURE(OPT_GOSSIP_QUERIES),
822 COMPULSORY_FEATURE(OPT_VAR_ONION),
823 COMPULSORY_FEATURE(OPT_PAYMENT_SECRET),
824 OPTIONAL_FEATURE(OPT_BASIC_MPP),
825 OPTIONAL_FEATURE(OPT_GOSSIP_QUERIES_EX),
826 OPTIONAL_FEATURE(OPT_STATIC_REMOTEKEY),
827 OPTIONAL_FEATURE(OPT_SHUTDOWN_ANYSEGWIT),
828 OPTIONAL_FEATURE(OPT_PAYMENT_METADATA),
829 OPTIONAL_FEATURE(OPT_SCID_ALIAS),
830 OPTIONAL_FEATURE(OPT_ZEROCONF),
831 OPTIONAL_FEATURE(OPT_CHANNEL_TYPE),
832#if EXPERIMENTAL_FEATURES
833 OPTIONAL_FEATURE(OPT_ANCHOR_OUTPUTS),
834 OPTIONAL_FEATURE(OPT_QUIESCE),
835 OPTIONAL_FEATURE(OPT_ONION_MESSAGES),
836#endif
837 };
838
839 for (size_t i = 0; i < ARRAY_SIZE(features); i++) {
840 struct feature_set *f
841 = feature_set_for_feature(NULL, features[i]);
842 if (!ret)
843 ret = tal_steal(ctx, f);
844 else
845 feature_set_or(ret, take(f));
846 }
847
848 return ret;
849}
850
851/*~ We need this function style to hand to ecdh_hsmd_setup, but it's just a thin
852 * wrapper around fatal() */

Callers 1

mainFunction · 0.85

Calls 2

feature_set_for_featureFunction · 0.50
feature_set_orFunction · 0.50

Tested by

no test coverage detected