Skip to content

Commit 297cf6e

Browse files
f don't use DEFAULT_MAX_PATH_LEN
1 parent 9fbd659 commit 297cf6e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lightning/src/ln/onion_utils.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::ln::msgs;
1717
use crate::ln::types::{PaymentHash, PaymentPreimage};
1818
use crate::ln::wire::Encode;
1919
use crate::routing::gossip::NetworkUpdate;
20-
use crate::routing::router::{Path, RouteHop, RouteParameters, MAX_PATH_LENGTH_ESTIMATE};
20+
use crate::routing::router::{Path, RouteHop, RouteParameters};
2121
use crate::sign::NodeSigner;
2222
use crate::util::errors::{self, APIError};
2323
use crate::util::logger::Logger;
@@ -379,10 +379,7 @@ pub(crate) fn set_max_path_length(
379379
.ok_or(())?;
380380

381381
route_params.payment_params.max_path_length =
382-
[max_path_length, route_params.payment_params.max_path_length, MAX_PATH_LENGTH_ESTIMATE]
383-
.into_iter()
384-
.min()
385-
.unwrap();
382+
core::cmp::min(max_path_length, route_params.payment_params.max_path_length);
386383
Ok(())
387384
}
388385

0 commit comments

Comments
 (0)