From 90cc9930b70244e5febdfc5a734561122c10e051 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 14 Dec 2023 22:49:58 +0000 Subject: [PATCH] Un-export the `PrivateRoute` inner field as there are invariants When we make the `PrivateRoute` inner `RouteHint` `pub`, we failed to note that the `PrivateRoute::new` constructor actually verifies a length invariant. Thus, we un-export the inner field and force users to go back through the `new` fn. --- lightning-invoice/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightning-invoice/src/lib.rs b/lightning-invoice/src/lib.rs index 89763aa75..c2e1ecf2d 100644 --- a/lightning-invoice/src/lib.rs +++ b/lightning-invoice/src/lib.rs @@ -527,7 +527,7 @@ impl Ord for Bolt11InvoiceSignature { /// The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops) /// #[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)] -pub struct PrivateRoute(pub RouteHint); +pub struct PrivateRoute(RouteHint); /// Tag constants as specified in BOLT11 #[allow(missing_docs)] -- 2.39.5