Skip to content

Commit fe73761

Browse files
committed
Add missing feature sanity checks
PaymentSecret and BasicMPP were added in d39f258 but the sanity test for supported features was missed.
1 parent 7ec16e5 commit fe73761

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lightning/src/ln/features.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,15 +299,15 @@ impl<T: sealed::PaymentSecret> Features<T> {
299299
// Note that we never need to test this since what really matters is the invoice - iff the
300300
// invoice provides a payment_secret, we assume that we can use it (ie that the recipient
301301
// supports payment_secret).
302-
pub(crate) fn payment_secret(&self) -> bool {
302+
pub(crate) fn supports_payment_secret(&self) -> bool {
303303
self.flags.len() > 1 && (self.flags[1] & (3 << (14-8))) != 0
304304
}
305305
}
306306

307307
impl<T: sealed::BasicMPP> Features<T> {
308308
// We currently never test for this since we don't actually *generate* multipath routes.
309309
#[allow(dead_code)]
310-
pub(crate) fn basic_mpp(&self) -> bool {
310+
pub(crate) fn supports_basic_mpp(&self) -> bool {
311311
self.flags.len() > 2 && (self.flags[2] & (3 << (16-8*2))) != 0
312312
}
313313
}
@@ -356,6 +356,12 @@ mod tests {
356356
assert!(InitFeatures::supported().supports_variable_length_onion());
357357
assert!(NodeFeatures::supported().supports_variable_length_onion());
358358

359+
assert!(InitFeatures::supported().supports_payment_secret());
360+
assert!(NodeFeatures::supported().supports_payment_secret());
361+
362+
assert!(InitFeatures::supported().supports_basic_mpp());
363+
assert!(NodeFeatures::supported().supports_basic_mpp());
364+
359365
let mut init_features = InitFeatures::supported();
360366
init_features.set_initial_routing_sync();
361367
assert!(!init_features.requires_unknown_bits());

0 commit comments

Comments
 (0)