File tree 2 files changed +304
-241
lines changed
2 files changed +304
-241
lines changed Original file line number Diff line number Diff line change @@ -33,15 +33,32 @@ pub struct Config {
33
33
/// Path to admin.macaroon file for lnd
34
34
macaroon_file : Option < String > ,
35
35
#[ clap( long) ]
36
+ /// Path to invoice.macaroon file for lnd
37
+ invoice_macaroon_file : Option < String > ,
38
+ #[ clap( long) ]
36
39
/// Include route hints in invoices
37
40
pub route_hints : bool ,
38
41
}
39
42
40
43
impl Config {
41
44
pub fn macaroon_file ( & self ) -> String {
42
- self . macaroon_file
43
- . clone ( )
44
- . unwrap_or_else ( || default_macaroon_file ( & self . network ) )
45
+ if self . macaroon_file . is_some ( ) && self . invoice_macaroon_file . is_some ( ) {
46
+ panic ! ( "cannot set --macaroon-file and --invoice-macaroon-file at the same time" )
47
+ }
48
+ match self . invoice_macaroon_file {
49
+ Some ( _) => self . invoice_macaroon_file . clone ( ) . unwrap ( ) ,
50
+ None => self
51
+ . macaroon_file
52
+ . clone ( )
53
+ . unwrap_or_else ( || default_macaroon_file ( & self . network ) ) ,
54
+ }
55
+ }
56
+
57
+ pub fn recv_only ( & self ) -> bool {
58
+ match self . invoice_macaroon_file {
59
+ Some ( _) => true ,
60
+ None => false ,
61
+ }
45
62
}
46
63
47
64
pub fn cert_file ( & self ) -> String {
You can’t perform that action at this time.
0 commit comments