From 42a58ef91087ccfd6becb90fa7bbab35c44c9277 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Tue, 9 Jun 2026 13:57:45 +0200 Subject: [PATCH] plugin: Enforce canonical LSPS ordering --- libs/gl-plugin/src/node/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/gl-plugin/src/node/mod.rs b/libs/gl-plugin/src/node/mod.rs index b6e68c465..933e2073c 100644 --- a/libs/gl-plugin/src/node/mod.rs +++ b/libs/gl-plugin/src/node/mod.rs @@ -296,10 +296,12 @@ impl Node for PluginNodeServer { // In case the client did not specify an LSP to work with, // let's enumerate them, and select the best option ourselves. - let lsps = self.get_lsps_offers(&mut rpc).await.map_err(|_e| { + let mut lsps = self.get_lsps_offers(&mut rpc).await.map_err(|_e| { Status::not_found("Could not retrieve LSPS peers for invoice negotiation.") })?; + lsps.sort_by_key(|l| l.node_id); + if lsps.len() < 1 { return Err(Status::not_found( "Could not find an LSP peer to negotiate the LSPS2 channel for this invoice.",