68
68
//! (see the [`Keysend` feature assignment proposal](https://github.com/lightning/bolts/issues/605#issuecomment-606679798) for more information).
69
69
//! - `Trampoline` - supports receiving and forwarding Trampoline payments
70
70
//! (see the [`Trampoline` feature proposal](https://github.com/lightning/bolts/pull/836) for more information).
71
+ //! - `provide_peer_backup_storage` - Indicates that we offer the capability to store data of our peers
72
+ //! (see https://github.com/lightning/bolts/pull/1110 for more info).
71
73
//!
72
74
//! LDK knows about the following features, but does not support them:
73
75
//! - `AnchorsNonzeroFeeHtlcTx` - the initial version of anchor outputs, which was later found to be
@@ -151,7 +153,7 @@ mod sealed {
151
153
// Byte 4
152
154
OnionMessages ,
153
155
// Byte 5
154
- ChannelType | SCIDPrivacy ,
156
+ ProvidePeerBackupStorage | ChannelType | SCIDPrivacy ,
155
157
// Byte 6
156
158
ZeroConf ,
157
159
// Byte 7
@@ -172,7 +174,7 @@ mod sealed {
172
174
// Byte 4
173
175
OnionMessages ,
174
176
// Byte 5
175
- ChannelType | SCIDPrivacy ,
177
+ ProvidePeerBackupStorage | ChannelType | SCIDPrivacy ,
176
178
// Byte 6
177
179
ZeroConf | Keysend ,
178
180
// Byte 7
@@ -519,6 +521,16 @@ mod sealed {
519
521
supports_onion_messages,
520
522
requires_onion_messages
521
523
) ;
524
+ define_feature ! (
525
+ 43 ,
526
+ ProvidePeerBackupStorage ,
527
+ [ InitContext , NodeContext ] ,
528
+ "Feature flags for `provide_peer_backup_storage`." ,
529
+ set_provide_peer_backup_storage_optional,
530
+ set_provide_peer_backup_storage_required,
531
+ supports_provide_peer_storage,
532
+ requires_provide_peer_storage
533
+ ) ;
522
534
define_feature ! (
523
535
45 ,
524
536
ChannelType ,
@@ -1157,6 +1169,14 @@ mod tests {
1157
1169
assert ! ( !features1. requires_unknown_bits_from( & features2) ) ;
1158
1170
assert ! ( !features2. requires_unknown_bits_from( & features1) ) ;
1159
1171
1172
+ features1. set_provide_peer_backup_storage_required ( ) ;
1173
+ assert ! ( features1. requires_unknown_bits_from( & features2) ) ;
1174
+ assert ! ( !features2. requires_unknown_bits_from( & features1) ) ;
1175
+
1176
+ features2. set_provide_peer_backup_storage_optional ( ) ;
1177
+ assert ! ( !features1. requires_unknown_bits_from( & features2) ) ;
1178
+ assert ! ( !features2. requires_unknown_bits_from( & features1) ) ;
1179
+
1160
1180
features1. set_data_loss_protect_required ( ) ;
1161
1181
assert ! ( features1. requires_unknown_bits_from( & features2) ) ;
1162
1182
assert ! ( !features2. requires_unknown_bits_from( & features1) ) ;
0 commit comments