File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1327,14 +1327,15 @@ where
13271327 ) ;
13281328 let mut allow_0conf =
13291329 self . config . trusted_peers_0conf . contains ( & counterparty_node_id) ;
1330- let mut channel_override_config = None ;
13311330
13321331 // If the peer is a configured LSP node, additionally honor its trust_peer_0conf flag.
1333- if let Some ( lsp) =
1334- self . liquidity_source . get_lsp_config ( & counterparty_node_id, 2 ) . await
1335- {
1336- allow_0conf = allow_0conf || lsp. trust_peer_0conf ;
1332+ if self . liquidity_source . get_lsp_trust_0conf ( & counterparty_node_id) == Some ( true ) {
1333+ allow_0conf = true ;
1334+ }
1335+
1336+ let mut channel_override_config = None ;
13371337
1338+ if self . liquidity_source . get_lsp_config ( & counterparty_node_id, 2 ) . await . is_some ( ) {
13381339 // When we're an LSPS2 client, allow claiming underpaying HTLCs as the LSP will skim off some fee. We'll
13391340 // check that they don't take too much before claiming.
13401341 channel_override_config = Some ( ChannelConfigOverrides {
Original file line number Diff line number Diff line change @@ -523,6 +523,15 @@ where
523523 . collect ( )
524524 }
525525
526+ pub ( crate ) fn get_lsp_trust_0conf ( & self , node_id : & PublicKey ) -> Option < bool > {
527+ self . lsp_nodes
528+ . read ( )
529+ . expect ( "lock" )
530+ . iter ( )
531+ . find ( |n| & n. node_id == node_id)
532+ . map ( |n| n. trust_peer_0conf )
533+ }
534+
526535 /// Flips the `discovery_done` watch to `true`.
527536 ///
528537 /// 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