mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 07:34:24 +01:00
features: make name of peer storage features match spec.
And we should always represent them as is, not as optional: it's possible in future we could *require* "WANT_PEER_BACKUP_STORAGE". Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Alex Myers
parent
68d9b21aec
commit
f1fed40ac2
@@ -136,12 +136,12 @@ static const struct feature_style feature_styles[] = {
|
|||||||
[NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT,
|
[NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT,
|
||||||
[BOLT11_FEATURE] = FEATURE_DONT_REPRESENT,
|
[BOLT11_FEATURE] = FEATURE_DONT_REPRESENT,
|
||||||
[CHANNEL_FEATURE] = FEATURE_DONT_REPRESENT } },
|
[CHANNEL_FEATURE] = FEATURE_DONT_REPRESENT } },
|
||||||
{ PEER_STORAGE_FEATURE,
|
{ OPT_WANT_PEER_BACKUP_STORAGE,
|
||||||
.copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT_AS_OPTIONAL,
|
.copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT,
|
||||||
[NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT_AS_OPTIONAL } },
|
[NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT } },
|
||||||
{ YOUR_PEER_STORAGE_FEATURE,
|
{ OPT_PROVIDE_PEER_BACKUP_STORAGE,
|
||||||
.copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT_AS_OPTIONAL,
|
.copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT,
|
||||||
[NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT_AS_OPTIONAL } },
|
[NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT } },
|
||||||
};
|
};
|
||||||
|
|
||||||
struct dependency {
|
struct dependency {
|
||||||
@@ -456,8 +456,8 @@ const char *feature_name(const tal_t *ctx, size_t f)
|
|||||||
"option_quiesce", /* https://github.com/lightning/bolts/pull/869 */
|
"option_quiesce", /* https://github.com/lightning/bolts/pull/869 */
|
||||||
NULL,
|
NULL,
|
||||||
"option_onion_messages", /* https://github.com/lightning/bolts/pull/759 */
|
"option_onion_messages", /* https://github.com/lightning/bolts/pull/759 */
|
||||||
"option_your_peer_storage", /* 40/41 */
|
"option_want_peer_backup_storage", /* 40/41 */ /* https://github.com/lightning/bolts/pull/881/files */
|
||||||
"option_peer_storage",
|
"option_provide_peer_backup_storage", /* https://github.com/lightning/bolts/pull/881/files */
|
||||||
"option_channel_type",
|
"option_channel_type",
|
||||||
"option_scid_alias", /* https://github.com/lightning/bolts/pull/910 */
|
"option_scid_alias", /* https://github.com/lightning/bolts/pull/910 */
|
||||||
"option_payment_metadata",
|
"option_payment_metadata",
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ enum feature_place {
|
|||||||
BOLT12_INVOICE_FEATURE,
|
BOLT12_INVOICE_FEATURE,
|
||||||
};
|
};
|
||||||
#define NUM_FEATURE_PLACE (BOLT12_INVOICE_FEATURE+1)
|
#define NUM_FEATURE_PLACE (BOLT12_INVOICE_FEATURE+1)
|
||||||
#define PEER_STORAGE_FEATURE 42
|
|
||||||
#define YOUR_PEER_STORAGE_FEATURE 40
|
|
||||||
extern const char *feature_place_names[NUM_FEATURE_PLACE];
|
extern const char *feature_place_names[NUM_FEATURE_PLACE];
|
||||||
|
|
||||||
/* The complete set of features for all contexts */
|
/* The complete set of features for all contexts */
|
||||||
@@ -166,4 +164,12 @@ struct feature_set *feature_set_dup(const tal_t *ctx,
|
|||||||
|
|
||||||
#define OPT_SHUTDOWN_WRONG_FUNDING 104
|
#define OPT_SHUTDOWN_WRONG_FUNDING 104
|
||||||
|
|
||||||
|
/* BOLT-peer-storage #9:
|
||||||
|
*
|
||||||
|
* | 40/41 | `want_peer_backup_storage` | Want to use other nodes to store encrypted backup data | IN ...
|
||||||
|
* | 42/43 | `provide_peer_backup_storage` | Can store other nodes' encrypted backup data | IN ...
|
||||||
|
*/
|
||||||
|
#define OPT_WANT_PEER_BACKUP_STORAGE 40
|
||||||
|
#define OPT_PROVIDE_PEER_BACKUP_STORAGE 42
|
||||||
|
|
||||||
#endif /* LIGHTNING_COMMON_FEATURES_H */
|
#endif /* LIGHTNING_COMMON_FEATURES_H */
|
||||||
|
|||||||
@@ -795,10 +795,10 @@ static const struct plugin_command commands[] = {
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
setup_locale();
|
setup_locale();
|
||||||
struct feature_set *features = feature_set_for_feature(NULL, PEER_STORAGE_FEATURE);
|
struct feature_set *features = feature_set_for_feature(NULL, OPT_WANT_PEER_BACKUP_STORAGE);
|
||||||
feature_set_or(features,
|
feature_set_or(features,
|
||||||
take(feature_set_for_feature(NULL,
|
take(feature_set_for_feature(NULL,
|
||||||
YOUR_PEER_STORAGE_FEATURE)));
|
OPT_PROVIDE_PEER_BACKUP_STORAGE)));
|
||||||
|
|
||||||
plugin_main(argv, init, PLUGIN_STATIC, true, features,
|
plugin_main(argv, init, PLUGIN_STATIC, true, features,
|
||||||
commands, ARRAY_SIZE(commands),
|
commands, ARRAY_SIZE(commands),
|
||||||
|
|||||||
Reference in New Issue
Block a user