File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1317,14 +1317,15 @@ where
13171317 ) ;
13181318 let mut allow_0conf =
13191319 self . config . trusted_peers_0conf . contains ( & counterparty_node_id) ;
1320- let mut channel_override_config = None ;
13211320
13221321 // If the peer is a configured LSP node, additionally honor its trust_peer_0conf flag.
1323- if let Some ( lsp) =
1324- self . liquidity_source . get_lsp_config ( & counterparty_node_id, 2 ) . await
1325- {
1326- allow_0conf = allow_0conf || lsp. trust_peer_0conf ;
1322+ if self . liquidity_source . get_lsp_trust_0conf ( & counterparty_node_id) == Some ( true ) {
1323+ allow_0conf = true ;
1324+ }
1325+
1326+ let mut channel_override_config = None ;
13271327
1328+ if self . liquidity_source . get_lsp_config ( & counterparty_node_id, 2 ) . await . is_some ( ) {
13281329 // When we're an LSPS2 client, allow claiming underpaying HTLCs as the LSP will skim off some fee. We'll
13291330 // check that they don't take too much before claiming.
13301331 channel_override_config = Some ( ChannelConfigOverrides {
Original file line number Diff line number Diff line change 1- // This file is Copyright its original authors, visible in version control history.
2- //
3- // This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4- // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
5- // http://opensource.org/licenses/MIT>, at your option. You may not use this file except in
6- // accordance with one or both of these licenses.
7-
8- pub ( crate ) mod lsps1;
9- pub ( crate ) mod lsps2;
10-
11- pub use lsps1:: LSPS1OrderStatus ;
1+ // This file is Copyright its original authors, visible in version control history.
2+ //
3+ // This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
5+ // http://opensource.org/licenses/MIT>, at your option. You may not use this file except in
6+ // accordance with one or both of these licenses.
7+
8+ pub ( crate ) mod lsps1;
9+ pub ( crate ) mod lsps2;
10+
11+ pub use lsps1:: LSPS1OrderStatus ;
Original file line number Diff line number Diff line change @@ -572,6 +572,15 @@ where
572572 . collect ( )
573573 }
574574
575+ pub ( crate ) fn get_lsp_trust_0conf ( & self , node_id : & PublicKey ) -> Option < bool > {
576+ self . lsp_nodes
577+ . read ( )
578+ . expect ( "lock" )
579+ . iter ( )
580+ . find ( |n| & n. node_id == node_id)
581+ . map ( |n| n. trust_peer_0conf )
582+ }
583+
575584 /// Flips the `discovery_done` watch to `true`.
576585 ///
577586 /// Called once after the *initial* batch of LSPs configured at build time has been
You can’t perform that action at this time.
0 commit comments