From: Matt Corallo Date: Thu, 14 Dec 2023 22:49:58 +0000 (+0000) Subject: Un-export the `PrivateRoute` inner field as there are invariants X-Git-Tag: v0.0.119~1^2~4 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=90cc9930b70244e5febdfc5a734561122c10e051;p=rust-lightning 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. --- 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)]