Skip to content

Commit

Permalink
Un-export the PrivateRoute inner field as there are invariants
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TheBlueMatt committed Dec 15, 2023
1 parent e1897de commit f2b4e17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lightning-invoice/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit f2b4e17

Please sign in to comment.