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.
This commit is contained in:
Matt Corallo 2023-12-14 22:49:58 +00:00
parent b9797ebdd9
commit 90cc9930b7

View file

@ -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)]