Skip to content

Commit d69fb17

Browse files
committed
plugin: Enforce canonical LSPS ordering
1 parent c13c796 commit d69fb17

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

libs/gl-plugin/src/node/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,12 @@ impl Node for PluginNodeServer {
296296

297297
// In case the client did not specify an LSP to work with,
298298
// let's enumerate them, and select the best option ourselves.
299-
let lsps = self.get_lsps_offers(&mut rpc).await.map_err(|_e| {
299+
let mut lsps = self.get_lsps_offers(&mut rpc).await.map_err(|_e| {
300300
Status::not_found("Could not retrieve LSPS peers for invoice negotiation.")
301301
})?;
302302

303+
lsps.sort_by_key(|l| l.node_id.clone());
304+
303305
if lsps.len() < 1 {
304306
return Err(Status::not_found(
305307
"Could not find an LSP peer to negotiate the LSPS2 channel for this invoice.",

0 commit comments

Comments
 (0)