@@ -508,6 +508,16 @@ impl<T: sealed::VariableLengthOnion> Features<T> {
508
508
pub ( crate ) fn supports_variable_length_onion ( & self ) -> bool {
509
509
<T as sealed:: VariableLengthOnion >:: supports_feature ( & self . flags )
510
510
}
511
+
512
+ /// Set these features as requiring the var_onion_optin feature.
513
+ pub fn set_supports_var_onion_optin ( & mut self ) {
514
+ <T as sealed:: VariableLengthOnion >:: set_optional_bit ( & mut self . flags ) ;
515
+ }
516
+
517
+ /// Set these features as supporting the var_onion_optin feature.
518
+ pub fn set_requires_var_onion_optin ( & mut self ) {
519
+ <T as sealed:: VariableLengthOnion >:: set_required_bit ( & mut self . flags ) ;
520
+ }
511
521
}
512
522
513
523
impl < T : sealed:: StaticRemoteKey > Features < T > {
@@ -545,6 +555,16 @@ impl<T: sealed::PaymentSecret> Features<T> {
545
555
pub ( crate ) fn supports_payment_secret ( & self ) -> bool {
546
556
<T as sealed:: PaymentSecret >:: supports_feature ( & self . flags )
547
557
}
558
+
559
+ /// Set these features as supporting the payment_secret feature.
560
+ pub fn set_supports_payment_secret ( & mut self ) {
561
+ <T as sealed:: PaymentSecret >:: set_optional_bit ( & mut self . flags ) ;
562
+ }
563
+
564
+ /// Set these features as requiring the payment_secret feature.
565
+ pub fn set_requires_payment_secret ( & mut self ) {
566
+ <T as sealed:: PaymentSecret >:: set_required_bit ( & mut self . flags ) ;
567
+ }
548
568
}
549
569
550
570
impl < T : sealed:: BasicMPP > Features < T > {
@@ -557,6 +577,16 @@ impl<T: sealed::BasicMPP> Features<T> {
557
577
pub ( crate ) fn supports_basic_mpp ( & self ) -> bool {
558
578
<T as sealed:: BasicMPP >:: supports_feature ( & self . flags )
559
579
}
580
+
581
+ /// Set these features as supporting the basic_mpp feature.
582
+ pub fn set_supports_basic_mpp ( & mut self ) {
583
+ <T as sealed:: BasicMPP >:: set_optional_bit ( & mut self . flags ) ;
584
+ }
585
+
586
+ /// Set these features as requiring the basic_mpp feature.
587
+ pub fn set_requires_basic_mpp ( & mut self ) {
588
+ <T as sealed:: BasicMPP >:: set_required_bit ( & mut self . flags ) ;
589
+ }
560
590
}
561
591
562
592
impl < T : sealed:: ShutdownAnySegwit > Features < T > {
0 commit comments