Merge pull request #29 from TheBlueMatt/main v0.0.98
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Fri, 11 Jun 2021 18:30:46 +0000 (18:30 +0000)
committerGitHub <noreply@github.com>
Fri, 11 Jun 2021 18:30:46 +0000 (18:30 +0000)
Update to upstream 0.0.98

12 files changed:
c-bindings-gen/src/types.rs
genbindings.sh
lightning-c-bindings/Cargo.toml
lightning-c-bindings/demo.cpp
lightning-c-bindings/include/ldk_rust_types.h
lightning-c-bindings/include/lightning.h
lightning-c-bindings/include/lightningpp.hpp
lightning-c-bindings/src/c_types/derived.rs
lightning-c-bindings/src/lightning/chain/mod.rs
lightning-c-bindings/src/lightning/routing/router.rs
lightning-c-bindings/src/lightning_invoice/constants.rs
lightning-c-bindings/src/lightning_invoice/mod.rs

index c21572f670a378bbcd21bdd24216584714521563..ff1d4b833581602d523e0fce0b46fb6ddc68d511 100644 (file)
@@ -1290,16 +1290,15 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
                                                        (").into(), Err(mut e) => crate::c_types::CResultTempl::err(".to_string(), "e".to_string())],
                                                ").into() }", ContainerPrefixLocation::PerConv))
                        },
-                       "Vec" if !is_ref => {
-                               Some(("Vec::new(); for mut item in ", vec![(format!(".drain(..) {{ local_{}.push(", var_name), "item".to_string())], "); }", ContainerPrefixLocation::PerConv))
-                       },
                        "Vec" => {
-                               // We should only get here if the single contained has an inner
-                               assert!(self.c_type_has_inner(single_contained.unwrap()));
-                               Some(("Vec::new(); for mut item in ", vec![(format!(".drain(..) {{ local_{}.push(", var_name), "*item".to_string())], "); }", ContainerPrefixLocation::PerConv))
+                               if is_ref {
+                                       // We should only get here if the single contained has an inner
+                                       assert!(self.c_type_has_inner(single_contained.unwrap()));
+                               }
+                               Some(("Vec::new(); for mut item in ", vec![(format!(".drain(..) {{ local_{}.push(", var_name), "item".to_string())], "); }", ContainerPrefixLocation::PerConv))
                        },
                        "Slice" => {
-                               Some(("Vec::new(); for item in ", vec![(format!(".iter() {{ local_{}.push(", var_name), "*item".to_string())], "); }", ContainerPrefixLocation::PerConv))
+                               Some(("Vec::new(); for item in ", vec![(format!(".iter() {{ local_{}.push(", var_name), "item".to_string())], "); }", ContainerPrefixLocation::PerConv))
                        },
                        "Option" => {
                                let contained_struct = if let Some(syn::Type::Path(p)) = single_contained {
index b5cbca366dace820b8dffcdfcdf8fcd748938d42..0e426022ca334c03420239475f31fbb6bb07193f 100755 (executable)
@@ -147,7 +147,17 @@ clang -o /dev/null -ffile-prefix-map=$HOME/.cargo= genbindings_path_map_test_fil
 # Now that we've done our last non-LTO build, turn on LTO in CFLAGS as well
 export BASE_CFLAGS="-ffile-prefix-map=$HOME/.cargo= -frandom-seed=42"
 ENV_TARGET=$(rustc --version --verbose | grep host | awk '{ print $2 }' | sed 's/-/_/g')
-export CFLAGS_$ENV_TARGET="$BASE_CFLAGS -march=sandybridge -mcpu=sandybridge -mtune=sandybridge"
+case "$ENV_TARGET" in
+       "x86_64"*)
+               export RUSTFLAGS="$RUSTFLAGS -C target-cpu=sandybridge"
+               export CFLAGS_$ENV_TARGET="$BASE_CFLAGS -march=sandybridge -mcpu=sandybridge -mtune=sandybridge"
+               ;;
+       *)
+               # Assume this isn't targeted at another host and build for the host's CPU.
+               export RUSTFLAGS="$RUSTFLAGS -C target-cpu=native"
+               export CFLAGS_$ENV_TARGET="$BASE_CFLAGS -mcpu=native"
+               ;;
+esac
 rm genbindings_path_map_test_file.c
 
 cargo build
index d06861d6ff7fccca6ec307cc8a04e38dab49b61c..93e4d86e57eef64f6cbe182123eeb2736560105f 100644 (file)
@@ -18,10 +18,10 @@ crate-type = ["staticlib"
 bitcoin = "0.26"
 secp256k1 = { version = "0.20.1", features = ["global-context-less-secure"] }
 # Note that the following line is matched by genbindings to update the path
-lightning = { git = "https://git.bitcoin.ninja/rust-lightning", rev = "a8038a8234b70bc261f633a9e2b40adebebcd8d4", features = ["allow_wallclock_use"] }
-lightning-persister = { git = "https://git.bitcoin.ninja/rust-lightning", rev = "a8038a8234b70bc261f633a9e2b40adebebcd8d4" }
-lightning-invoice = { git = "https://git.bitcoin.ninja/rust-lightning", rev = "a8038a8234b70bc261f633a9e2b40adebebcd8d4" }
-lightning-background-processor = { git = "https://git.bitcoin.ninja/rust-lightning", rev = "a8038a8234b70bc261f633a9e2b40adebebcd8d4" }
+lightning = { git = "https://github.com/rust-bitcoin/rust-lightning", rev = "294009969aef617df4184ff41ef6daa5a445f213", features = ["allow_wallclock_use"] }
+lightning-persister = { git = "https://github.com/rust-bitcoin/rust-lightning", rev = "294009969aef617df4184ff41ef6daa5a445f213" }
+lightning-invoice = { git = "https://github.com/rust-bitcoin/rust-lightning", rev = "294009969aef617df4184ff41ef6daa5a445f213" }
+lightning-background-processor = { git = "https://github.com/rust-bitcoin/rust-lightning", rev = "294009969aef617df4184ff41ef6daa5a445f213" }
 
 [patch.crates-io]
 # Rust-Secp256k1 upstream to get PR 279 until it is released.
index 1d83b21003966ff1d520e764a33265ea052a8403..b908de5dd1589f533b101272bd01f2e36582a048 100644 (file)
@@ -524,9 +524,8 @@ int main() {
                        LDK::NetworkGraph graph_2_ref = LockedNetworkGraph_graph(&graph_2_locked);
                        LDK::CResult_RouteLightningErrorZ route = get_route(ChannelManager_get_our_node_id(&cm1), &graph_2_ref, ChannelManager_get_our_node_id(&cm2), LDKInvoiceFeatures {
                                        .inner = NULL, .is_owned = false
-                               }, &outbound_channels, LDKCVec_RouteHintHopZ {
-                                       .data = NULL, .datalen = 0
-                               }, 5000, Invoice_min_final_cltv_expiry(invoice->contents.result), logger1);
+                               }, &outbound_channels, Invoice_route_hints(invoice->contents.result),
+                               5000, Invoice_min_final_cltv_expiry(invoice->contents.result), logger1);
                        assert(route->result_ok);
                        LDK::CResult_NonePaymentSendFailureZ send_res = ChannelManager_send_payment(&cm1, route->contents.result, payment_hash, Invoice_payment_secret(invoice->contents.result));
                        assert(send_res->result_ok);
index 3138c9e69921a1dc30ac49084bae644e34f167f6..114f78928682b682079cb90712e011be59024afe 100644 (file)
@@ -36,6 +36,8 @@ struct nativeRouteHopOpaque;
 typedef struct nativeRouteHopOpaque LDKnativeRouteHop;
 struct nativeRouteOpaque;
 typedef struct nativeRouteOpaque LDKnativeRoute;
+struct nativeRouteHintOpaque;
+typedef struct nativeRouteHintOpaque LDKnativeRouteHint;
 struct nativeRouteHintHopOpaque;
 typedef struct nativeRouteHintHopOpaque LDKnativeRouteHintHop;
 struct nativeWatchedOutputOpaque;
@@ -102,8 +104,8 @@ struct nativeMinFinalCltvExpiryOpaque;
 typedef struct nativeMinFinalCltvExpiryOpaque LDKnativeMinFinalCltvExpiry;
 struct nativeInvoiceSignatureOpaque;
 typedef struct nativeInvoiceSignatureOpaque LDKnativeInvoiceSignature;
-struct nativeRouteHintOpaque;
-typedef struct nativeRouteHintOpaque LDKnativeRouteHint;
+struct nativePrivateRouteOpaque;
+typedef struct nativePrivateRouteOpaque LDKnativePrivateRoute;
 struct nativeChannelMonitorUpdateOpaque;
 typedef struct nativeChannelMonitorUpdateOpaque LDKnativeChannelMonitorUpdate;
 struct nativeMonitorUpdateErrorOpaque;
index 8d27f343936b3071c1a28a4cce38d788ae88a072..8fe104873df2a9c011bfef88e18905f7014ecb4b 100644 (file)
@@ -1425,38 +1425,38 @@ typedef struct LDKCVec_ChannelDetailsZ {
 
 
 /**
- * A channel descriptor which provides a last-hop route to get_route
+ * A list of hops along a payment path terminating with a channel to the recipient.
  */
-typedef struct MUST_USE_STRUCT LDKRouteHintHop {
+typedef struct MUST_USE_STRUCT LDKRouteHint {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeRouteHintHop *inner;
+   LDKnativeRouteHint *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKRouteHintHop;
+} LDKRouteHint;
 
 /**
- * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
+ * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
  * This corresponds to std::vector in C++
  */
-typedef struct LDKCVec_RouteHintHopZ {
+typedef struct LDKCVec_RouteHintZ {
    /**
     * The elements in the array.
     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
     */
-   struct LDKRouteHintHop *data;
+   struct LDKRouteHint *data;
    /**
     * The number of elements pointed to by `data`.
     */
    uintptr_t datalen;
-} LDKCVec_RouteHintHopZ;
+} LDKCVec_RouteHintZ;
 
 
 
@@ -4805,36 +4805,36 @@ typedef struct LDKCResult_PayeePubKeyErrorZ {
  * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
  *
  */
-typedef struct MUST_USE_STRUCT LDKRouteHint {
+typedef struct MUST_USE_STRUCT LDKPrivateRoute {
    /**
     * A pointer to the opaque Rust object.
     * Nearly everywhere, inner must be non-null, however in places where
     * the Rust equivalent takes an Option, it may be set to null to indicate None.
     */
-   LDKnativeRouteHint *inner;
+   LDKnativePrivateRoute *inner;
    /**
     * Indicates that this is the only struct which contains the same pointer.
     * Rust functions which take ownership of an object provided via an argument require
     * this to be true and invalidate the object pointed to by inner.
     */
    bool is_owned;
-} LDKRouteHint;
+} LDKPrivateRoute;
 
 /**
- * A dynamically-allocated array of crate::lightning_invoice::RouteHints of arbitrary size.
+ * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
  * This corresponds to std::vector in C++
  */
-typedef struct LDKCVec_RouteHintZ {
+typedef struct LDKCVec_PrivateRouteZ {
    /**
     * The elements in the array.
     * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
     */
-   struct LDKRouteHint *data;
+   struct LDKPrivateRoute *data;
    /**
     * The number of elements pointed to by `data`.
     */
    uintptr_t datalen;
-} LDKCVec_RouteHintZ;
+} LDKCVec_PrivateRouteZ;
 
 
 
@@ -5075,37 +5075,37 @@ typedef struct LDKCResult_ExpiryTimeCreationErrorZ {
 } LDKCResult_ExpiryTimeCreationErrorZ;
 
 /**
- * The contents of CResult_RouteHintCreationErrorZ
+ * The contents of CResult_PrivateRouteCreationErrorZ
  */
-typedef union LDKCResult_RouteHintCreationErrorZPtr {
+typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
    /**
     * A pointer to the contents in the success state.
     * Reading from this pointer when `result_ok` is not set is undefined.
     */
-   struct LDKRouteHint *result;
+   struct LDKPrivateRoute *result;
    /**
     * A pointer to the contents in the error state.
     * Reading from this pointer when `result_ok` is set is undefined.
     */
    enum LDKCreationError *err;
-} LDKCResult_RouteHintCreationErrorZPtr;
+} LDKCResult_PrivateRouteCreationErrorZPtr;
 
 /**
- * A CResult_RouteHintCreationErrorZ represents the result of a fallible operation,
- * containing a crate::lightning_invoice::RouteHint on success and a crate::lightning_invoice::CreationError on failure.
+ * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
+ * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
  * `result_ok` indicates the overall state, and the contents are provided via `contents`.
  */
-typedef struct LDKCResult_RouteHintCreationErrorZ {
+typedef struct LDKCResult_PrivateRouteCreationErrorZ {
    /**
-    * The contents of this CResult_RouteHintCreationErrorZ, accessible via either
+    * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
     * `err` or `result` depending on the state of `result_ok`.
     */
-   union LDKCResult_RouteHintCreationErrorZPtr contents;
+   union LDKCResult_PrivateRouteCreationErrorZPtr contents;
    /**
-    * Whether this CResult_RouteHintCreationErrorZ represents a success state.
+    * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
     */
    bool result_ok;
-} LDKCResult_RouteHintCreationErrorZ;
+} LDKCResult_PrivateRouteCreationErrorZ;
 
 /**
  * The contents of CResult_StringErrorZ
@@ -8745,6 +8745,26 @@ typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
 
 
 
+/**
+ * A channel descriptor for a hop along a payment path.
+ */
+typedef struct MUST_USE_STRUCT LDKRouteHintHop {
+   /**
+    * A pointer to the opaque Rust object.
+    * Nearly everywhere, inner must be non-null, however in places where
+    * the Rust equivalent takes an Option, it may be set to null to indicate None.
+    */
+   LDKnativeRouteHintHop *inner;
+   /**
+    * Indicates that this is the only struct which contains the same pointer.
+    * Rust functions which take ownership of an object provided via an argument require
+    * this to be true and invalidate the object pointed to by inner.
+    */
+   bool is_owned;
+} LDKRouteHintHop;
+
+
+
 /**
  * A simple newtype for RwLockReadGuard<'a, NetworkGraph>.
  * This exists only to make accessing a RwLock<NetworkGraph> possible from
@@ -9016,7 +9036,7 @@ extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
 
 extern const uint8_t TAG_FALLBACK;
 
-extern const uint8_t TAG_ROUTE;
+extern const uint8_t TAG_PRIVATE_ROUTE;
 
 extern const uint8_t TAG_PAYMENT_SECRET;
 
@@ -9435,7 +9455,7 @@ void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
-void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
+void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
 
 /**
  * Creates a new CResult_RouteLightningErrorZ in the success state.
@@ -10162,7 +10182,7 @@ struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct
 /**
  * Frees the buffer pointed to by `data` if `datalen` is non-0.
  */
-void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
+void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
 
 /**
  * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
@@ -10270,25 +10290,25 @@ void CResult_ExpiryTimeCreationErrorZ_free(struct LDKCResult_ExpiryTimeCreationE
 struct LDKCResult_ExpiryTimeCreationErrorZ CResult_ExpiryTimeCreationErrorZ_clone(const struct LDKCResult_ExpiryTimeCreationErrorZ *NONNULL_PTR orig);
 
 /**
- * Creates a new CResult_RouteHintCreationErrorZ in the success state.
+ * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
  */
-struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_ok(struct LDKRouteHint o);
+struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
 
 /**
- * Creates a new CResult_RouteHintCreationErrorZ in the error state.
+ * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
  */
-struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_err(enum LDKCreationError e);
+struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
 
 /**
- * Frees any resources used by the CResult_RouteHintCreationErrorZ.
+ * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
  */
-void CResult_RouteHintCreationErrorZ_free(struct LDKCResult_RouteHintCreationErrorZ _res);
+void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
 
 /**
- * Creates a new CResult_RouteHintCreationErrorZ which has the same data as `orig`
+ * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
  * but with all dynamically-allocated buffers duplicated in new buffers.
  */
-struct LDKCResult_RouteHintCreationErrorZ CResult_RouteHintCreationErrorZ_clone(const struct LDKCResult_RouteHintCreationErrorZ *NONNULL_PTR orig);
+struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
 
 /**
  * Creates a new CResult_StringErrorZ in the success state.
@@ -17088,6 +17108,23 @@ struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
  */
 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
 
+/**
+ * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
+ */
+void RouteHint_free(struct LDKRouteHint this_obj);
+
+/**
+ * Checks if two RouteHints contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
+
+/**
+ * Creates a copy of the RouteHint
+ */
+struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
+
 /**
  * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
  */
@@ -17176,8 +17213,8 @@ struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_
  * If the payee provided features in their invoice, they should be provided via payee_features.
  * Without this, MPP will only be used if the payee's features are available in the network graph.
  *
- * Extra routing hops between known nodes and the target will be used if they are included in
- * last_hops.
+ * Private routing paths between a public node and the target may be included in `last_hops`.
+ * Currently, only the last hop in each path is considered.
  *
  * If some channels aren't announced, it may be useful to fill in a first_hops with the
  * results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
@@ -17191,7 +17228,7 @@ struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_
  * equal), however the enabled/disabled bit on such channels as well as the
  * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
  */
-struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKInvoiceFeatures payee_features, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintHopZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
+struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKInvoiceFeatures payee_features, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
 
 /**
  * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
@@ -18087,21 +18124,21 @@ bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const
 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
 
 /**
- * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
+ * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
  */
-void RouteHint_free(struct LDKRouteHint this_obj);
+void PrivateRoute_free(struct LDKPrivateRoute this_obj);
 
 /**
- * Checks if two RouteHints contain equal inner contents.
+ * Checks if two PrivateRoutes contain equal inner contents.
  * This ignores pointers and is_owned flags and looks at the values in fields.
  * Two objects with NULL inner values will be considered "equal" here.
  */
-bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
+bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
 
 /**
- * Creates a copy of the RouteHint
+ * Creates a copy of the PrivateRoute
  */
-struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
+struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
 
 /**
  * Disassembles the `SignedRawInvoice` into its three parts:
@@ -18158,7 +18195,7 @@ MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDK
 
 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
 
-MUST_USE_RES struct LDKCVec_RouteHintZ RawInvoice_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
 
 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
 
@@ -18199,7 +18236,7 @@ MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoic
 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
 
 /**
- * Constructs an `Invoice` from a `SignedInvoice` by checking all its invariants.
+ * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
  * ```
  * use lightning_invoice::*;
  *
@@ -18259,7 +18296,12 @@ MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NON
 /**
  * Returns a list of all routes included in the invoice
  */
-MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
+MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
+
+/**
+ * Returns a list of all routes included in the invoice as the underlying hints
+ */
+MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
 
 /**
  * Returns the currency for which the invoice was issued
@@ -18309,14 +18351,14 @@ MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_
 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
 
 /**
- * Create a new (partial) route from a list of hops
+ * Creates a new (partial) route from a list of hops
  */
-MUST_USE_RES struct LDKCResult_RouteHintCreationErrorZ RouteHint_new(struct LDKCVec_RouteHintHopZ hops);
+MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
 
 /**
- * Returrn the underlying vector of hops
+ * Returns the underlying list of hops
  */
-MUST_USE_RES struct LDKCVec_RouteHintHopZ RouteHint_into_inner(struct LDKRouteHint this_arg);
+MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
 
 /**
  * Creates a copy of the CreationError
index 0cd1dc46eac215ad99627517ac615028a8286ea7..0b0a417e64c860f27ac653476dcb6ac080a22cc5 100644 (file)
@@ -210,6 +210,21 @@ public:
        const LDKRoute* operator &() const { return &self; }
        const LDKRoute* operator ->() const { return &self; }
 };
+class RouteHint {
+private:
+       LDKRouteHint self;
+public:
+       RouteHint(const RouteHint&) = delete;
+       RouteHint(RouteHint&& o) : self(o.self) { memset(&o, 0, sizeof(RouteHint)); }
+       RouteHint(LDKRouteHint&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKRouteHint)); }
+       operator LDKRouteHint() && { LDKRouteHint res = self; memset(&self, 0, sizeof(LDKRouteHint)); return res; }
+       ~RouteHint() { RouteHint_free(self); }
+       RouteHint& operator=(RouteHint&& o) { RouteHint_free(self); self = o.self; memset(&o, 0, sizeof(RouteHint)); return *this; }
+       LDKRouteHint* operator &() { return &self; }
+       LDKRouteHint* operator ->() { return &self; }
+       const LDKRouteHint* operator &() const { return &self; }
+       const LDKRouteHint* operator ->() const { return &self; }
+};
 class RouteHintHop {
 private:
        LDKRouteHintHop self;
@@ -1031,20 +1046,20 @@ public:
        const LDKInvoiceSignature* operator &() const { return &self; }
        const LDKInvoiceSignature* operator ->() const { return &self; }
 };
-class RouteHint {
+class PrivateRoute {
 private:
-       LDKRouteHint self;
+       LDKPrivateRoute self;
 public:
-       RouteHint(const RouteHint&) = delete;
-       RouteHint(RouteHint&& o) : self(o.self) { memset(&o, 0, sizeof(RouteHint)); }
-       RouteHint(LDKRouteHint&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKRouteHint)); }
-       operator LDKRouteHint() && { LDKRouteHint res = self; memset(&self, 0, sizeof(LDKRouteHint)); return res; }
-       ~RouteHint() { RouteHint_free(self); }
-       RouteHint& operator=(RouteHint&& o) { RouteHint_free(self); self = o.self; memset(&o, 0, sizeof(RouteHint)); return *this; }
-       LDKRouteHint* operator &() { return &self; }
-       LDKRouteHint* operator ->() { return &self; }
-       const LDKRouteHint* operator &() const { return &self; }
-       const LDKRouteHint* operator ->() const { return &self; }
+       PrivateRoute(const PrivateRoute&) = delete;
+       PrivateRoute(PrivateRoute&& o) : self(o.self) { memset(&o, 0, sizeof(PrivateRoute)); }
+       PrivateRoute(LDKPrivateRoute&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKPrivateRoute)); }
+       operator LDKPrivateRoute() && { LDKPrivateRoute res = self; memset(&self, 0, sizeof(LDKPrivateRoute)); return res; }
+       ~PrivateRoute() { PrivateRoute_free(self); }
+       PrivateRoute& operator=(PrivateRoute&& o) { PrivateRoute_free(self); self = o.self; memset(&o, 0, sizeof(PrivateRoute)); return *this; }
+       LDKPrivateRoute* operator &() { return &self; }
+       LDKPrivateRoute* operator ->() { return &self; }
+       const LDKPrivateRoute* operator &() const { return &self; }
+       const LDKPrivateRoute* operator ->() const { return &self; }
 };
 class CreationError {
 private:
@@ -2932,21 +2947,6 @@ public:
        const LDKCVec_RouteHopZ* operator &() const { return &self; }
        const LDKCVec_RouteHopZ* operator ->() const { return &self; }
 };
-class CResult_RouteHintCreationErrorZ {
-private:
-       LDKCResult_RouteHintCreationErrorZ self;
-public:
-       CResult_RouteHintCreationErrorZ(const CResult_RouteHintCreationErrorZ&) = delete;
-       CResult_RouteHintCreationErrorZ(CResult_RouteHintCreationErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_RouteHintCreationErrorZ)); }
-       CResult_RouteHintCreationErrorZ(LDKCResult_RouteHintCreationErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_RouteHintCreationErrorZ)); }
-       operator LDKCResult_RouteHintCreationErrorZ() && { LDKCResult_RouteHintCreationErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_RouteHintCreationErrorZ)); return res; }
-       ~CResult_RouteHintCreationErrorZ() { CResult_RouteHintCreationErrorZ_free(self); }
-       CResult_RouteHintCreationErrorZ& operator=(CResult_RouteHintCreationErrorZ&& o) { CResult_RouteHintCreationErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_RouteHintCreationErrorZ)); return *this; }
-       LDKCResult_RouteHintCreationErrorZ* operator &() { return &self; }
-       LDKCResult_RouteHintCreationErrorZ* operator ->() { return &self; }
-       const LDKCResult_RouteHintCreationErrorZ* operator &() const { return &self; }
-       const LDKCResult_RouteHintCreationErrorZ* operator ->() const { return &self; }
-};
 class CVec_C2Tuple_BlockHashChannelMonitorZZ {
 private:
        LDKCVec_C2Tuple_BlockHashChannelMonitorZZ self;
@@ -3097,21 +3097,6 @@ public:
        const LDKCResult_SignatureNoneZ* operator &() const { return &self; }
        const LDKCResult_SignatureNoneZ* operator ->() const { return &self; }
 };
-class CVec_RouteHintHopZ {
-private:
-       LDKCVec_RouteHintHopZ self;
-public:
-       CVec_RouteHintHopZ(const CVec_RouteHintHopZ&) = delete;
-       CVec_RouteHintHopZ(CVec_RouteHintHopZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_RouteHintHopZ)); }
-       CVec_RouteHintHopZ(LDKCVec_RouteHintHopZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_RouteHintHopZ)); }
-       operator LDKCVec_RouteHintHopZ() && { LDKCVec_RouteHintHopZ res = self; memset(&self, 0, sizeof(LDKCVec_RouteHintHopZ)); return res; }
-       ~CVec_RouteHintHopZ() { CVec_RouteHintHopZ_free(self); }
-       CVec_RouteHintHopZ& operator=(CVec_RouteHintHopZ&& o) { CVec_RouteHintHopZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_RouteHintHopZ)); return *this; }
-       LDKCVec_RouteHintHopZ* operator &() { return &self; }
-       LDKCVec_RouteHintHopZ* operator ->() { return &self; }
-       const LDKCVec_RouteHintHopZ* operator &() const { return &self; }
-       const LDKCVec_RouteHintHopZ* operator ->() const { return &self; }
-};
 class C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
 private:
        LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ self;
@@ -3832,20 +3817,20 @@ public:
        const LDKCResult_ChannelConfigDecodeErrorZ* operator &() const { return &self; }
        const LDKCResult_ChannelConfigDecodeErrorZ* operator ->() const { return &self; }
 };
-class CResult_RevokeAndACKDecodeErrorZ {
+class CVec_PrivateRouteZ {
 private:
-       LDKCResult_RevokeAndACKDecodeErrorZ self;
+       LDKCVec_PrivateRouteZ self;
 public:
-       CResult_RevokeAndACKDecodeErrorZ(const CResult_RevokeAndACKDecodeErrorZ&) = delete;
-       CResult_RevokeAndACKDecodeErrorZ(CResult_RevokeAndACKDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_RevokeAndACKDecodeErrorZ)); }
-       CResult_RevokeAndACKDecodeErrorZ(LDKCResult_RevokeAndACKDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_RevokeAndACKDecodeErrorZ)); }
-       operator LDKCResult_RevokeAndACKDecodeErrorZ() && { LDKCResult_RevokeAndACKDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_RevokeAndACKDecodeErrorZ)); return res; }
-       ~CResult_RevokeAndACKDecodeErrorZ() { CResult_RevokeAndACKDecodeErrorZ_free(self); }
-       CResult_RevokeAndACKDecodeErrorZ& operator=(CResult_RevokeAndACKDecodeErrorZ&& o) { CResult_RevokeAndACKDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_RevokeAndACKDecodeErrorZ)); return *this; }
-       LDKCResult_RevokeAndACKDecodeErrorZ* operator &() { return &self; }
-       LDKCResult_RevokeAndACKDecodeErrorZ* operator ->() { return &self; }
-       const LDKCResult_RevokeAndACKDecodeErrorZ* operator &() const { return &self; }
-       const LDKCResult_RevokeAndACKDecodeErrorZ* operator ->() const { return &self; }
+       CVec_PrivateRouteZ(const CVec_PrivateRouteZ&) = delete;
+       CVec_PrivateRouteZ(CVec_PrivateRouteZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_PrivateRouteZ)); }
+       CVec_PrivateRouteZ(LDKCVec_PrivateRouteZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_PrivateRouteZ)); }
+       operator LDKCVec_PrivateRouteZ() && { LDKCVec_PrivateRouteZ res = self; memset(&self, 0, sizeof(LDKCVec_PrivateRouteZ)); return res; }
+       ~CVec_PrivateRouteZ() { CVec_PrivateRouteZ_free(self); }
+       CVec_PrivateRouteZ& operator=(CVec_PrivateRouteZ&& o) { CVec_PrivateRouteZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_PrivateRouteZ)); return *this; }
+       LDKCVec_PrivateRouteZ* operator &() { return &self; }
+       LDKCVec_PrivateRouteZ* operator ->() { return &self; }
+       const LDKCVec_PrivateRouteZ* operator &() const { return &self; }
+       const LDKCVec_PrivateRouteZ* operator ->() const { return &self; }
 };
 class CResult_SpendableOutputDescriptorDecodeErrorZ {
 private:
@@ -3862,6 +3847,21 @@ public:
        const LDKCResult_SpendableOutputDescriptorDecodeErrorZ* operator &() const { return &self; }
        const LDKCResult_SpendableOutputDescriptorDecodeErrorZ* operator ->() const { return &self; }
 };
+class CResult_RevokeAndACKDecodeErrorZ {
+private:
+       LDKCResult_RevokeAndACKDecodeErrorZ self;
+public:
+       CResult_RevokeAndACKDecodeErrorZ(const CResult_RevokeAndACKDecodeErrorZ&) = delete;
+       CResult_RevokeAndACKDecodeErrorZ(CResult_RevokeAndACKDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_RevokeAndACKDecodeErrorZ)); }
+       CResult_RevokeAndACKDecodeErrorZ(LDKCResult_RevokeAndACKDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_RevokeAndACKDecodeErrorZ)); }
+       operator LDKCResult_RevokeAndACKDecodeErrorZ() && { LDKCResult_RevokeAndACKDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_RevokeAndACKDecodeErrorZ)); return res; }
+       ~CResult_RevokeAndACKDecodeErrorZ() { CResult_RevokeAndACKDecodeErrorZ_free(self); }
+       CResult_RevokeAndACKDecodeErrorZ& operator=(CResult_RevokeAndACKDecodeErrorZ&& o) { CResult_RevokeAndACKDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_RevokeAndACKDecodeErrorZ)); return *this; }
+       LDKCResult_RevokeAndACKDecodeErrorZ* operator &() { return &self; }
+       LDKCResult_RevokeAndACKDecodeErrorZ* operator ->() { return &self; }
+       const LDKCResult_RevokeAndACKDecodeErrorZ* operator &() const { return &self; }
+       const LDKCResult_RevokeAndACKDecodeErrorZ* operator ->() const { return &self; }
+};
 class CResult_UnsignedChannelUpdateDecodeErrorZ {
 private:
        LDKCResult_UnsignedChannelUpdateDecodeErrorZ self;
@@ -4012,6 +4012,21 @@ public:
        const LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* operator &() const { return &self; }
        const LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* operator ->() const { return &self; }
 };
+class CResult_PrivateRouteCreationErrorZ {
+private:
+       LDKCResult_PrivateRouteCreationErrorZ self;
+public:
+       CResult_PrivateRouteCreationErrorZ(const CResult_PrivateRouteCreationErrorZ&) = delete;
+       CResult_PrivateRouteCreationErrorZ(CResult_PrivateRouteCreationErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_PrivateRouteCreationErrorZ)); }
+       CResult_PrivateRouteCreationErrorZ(LDKCResult_PrivateRouteCreationErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_PrivateRouteCreationErrorZ)); }
+       operator LDKCResult_PrivateRouteCreationErrorZ() && { LDKCResult_PrivateRouteCreationErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_PrivateRouteCreationErrorZ)); return res; }
+       ~CResult_PrivateRouteCreationErrorZ() { CResult_PrivateRouteCreationErrorZ_free(self); }
+       CResult_PrivateRouteCreationErrorZ& operator=(CResult_PrivateRouteCreationErrorZ&& o) { CResult_PrivateRouteCreationErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_PrivateRouteCreationErrorZ)); return *this; }
+       LDKCResult_PrivateRouteCreationErrorZ* operator &() { return &self; }
+       LDKCResult_PrivateRouteCreationErrorZ* operator ->() { return &self; }
+       const LDKCResult_PrivateRouteCreationErrorZ* operator &() const { return &self; }
+       const LDKCResult_PrivateRouteCreationErrorZ* operator ->() const { return &self; }
+};
 class CResult_boolPeerHandleErrorZ {
 private:
        LDKCResult_boolPeerHandleErrorZ self;
index 0e48f5d593518ecc214d76176a09581520060ed4..33325e2539e0ccd77c66e9a00d2e62138211ab16 100644 (file)
@@ -1661,29 +1661,29 @@ impl Clone for CVec_ChannelDetailsZ {
        }
 }
 #[repr(C)]
-/// A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
+/// A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
 /// This corresponds to std::vector in C++
-pub struct CVec_RouteHintHopZ {
+pub struct CVec_RouteHintZ {
        /// The elements in the array.
        /// If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
-       pub data: *mut crate::lightning::routing::router::RouteHintHop,
+       pub data: *mut crate::lightning::routing::router::RouteHint,
        /// The number of elements pointed to by `data`.
        pub datalen: usize
 }
-impl CVec_RouteHintHopZ {
-       #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::routing::router::RouteHintHop> {
+impl CVec_RouteHintZ {
+       #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::routing::router::RouteHint> {
                if self.datalen == 0 { return Vec::new(); }
                let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
                self.data = std::ptr::null_mut();
                self.datalen = 0;
                ret
        }
-       #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::routing::router::RouteHintHop] {
+       #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::routing::router::RouteHint] {
                unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
        }
 }
-impl From<Vec<crate::lightning::routing::router::RouteHintHop>> for CVec_RouteHintHopZ {
-       fn from(v: Vec<crate::lightning::routing::router::RouteHintHop>) -> Self {
+impl From<Vec<crate::lightning::routing::router::RouteHint>> for CVec_RouteHintZ {
+       fn from(v: Vec<crate::lightning::routing::router::RouteHint>) -> Self {
                let datalen = v.len();
                let data = Box::into_raw(v.into_boxed_slice());
                Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
@@ -1691,14 +1691,14 @@ impl From<Vec<crate::lightning::routing::router::RouteHintHop>> for CVec_RouteHi
 }
 #[no_mangle]
 /// Frees the buffer pointed to by `data` if `datalen` is non-0.
-pub extern "C" fn CVec_RouteHintHopZ_free(_res: CVec_RouteHintHopZ) { }
-impl Drop for CVec_RouteHintHopZ {
+pub extern "C" fn CVec_RouteHintZ_free(_res: CVec_RouteHintZ) { }
+impl Drop for CVec_RouteHintZ {
        fn drop(&mut self) {
                if self.datalen == 0 { return; }
                unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
        }
 }
-impl Clone for CVec_RouteHintHopZ {
+impl Clone for CVec_RouteHintZ {
        fn clone(&self) -> Self {
                let mut res = Vec::new();
                if self.datalen == 0 { return Self::from(res); }
@@ -4957,29 +4957,29 @@ impl Clone for CResult_PayeePubKeyErrorZ {
 /// but with all dynamically-allocated buffers duplicated in new buffers.
 pub extern "C" fn CResult_PayeePubKeyErrorZ_clone(orig: &CResult_PayeePubKeyErrorZ) -> CResult_PayeePubKeyErrorZ { orig.clone() }
 #[repr(C)]
-/// A dynamically-allocated array of crate::lightning_invoice::RouteHints of arbitrary size.
+/// A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
 /// This corresponds to std::vector in C++
-pub struct CVec_RouteHintZ {
+pub struct CVec_PrivateRouteZ {
        /// The elements in the array.
        /// If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
-       pub data: *mut crate::lightning_invoice::RouteHint,
+       pub data: *mut crate::lightning_invoice::PrivateRoute,
        /// The number of elements pointed to by `data`.
        pub datalen: usize
 }
-impl CVec_RouteHintZ {
-       #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning_invoice::RouteHint> {
+impl CVec_PrivateRouteZ {
+       #[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning_invoice::PrivateRoute> {
                if self.datalen == 0 { return Vec::new(); }
                let ret = unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) }.into();
                self.data = std::ptr::null_mut();
                self.datalen = 0;
                ret
        }
-       #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning_invoice::RouteHint] {
+       #[allow(unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning_invoice::PrivateRoute] {
                unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) }
        }
 }
-impl From<Vec<crate::lightning_invoice::RouteHint>> for CVec_RouteHintZ {
-       fn from(v: Vec<crate::lightning_invoice::RouteHint>) -> Self {
+impl From<Vec<crate::lightning_invoice::PrivateRoute>> for CVec_PrivateRouteZ {
+       fn from(v: Vec<crate::lightning_invoice::PrivateRoute>) -> Self {
                let datalen = v.len();
                let data = Box::into_raw(v.into_boxed_slice());
                Self { datalen, data: unsafe { (*data).as_mut_ptr() } }
@@ -4987,14 +4987,14 @@ impl From<Vec<crate::lightning_invoice::RouteHint>> for CVec_RouteHintZ {
 }
 #[no_mangle]
 /// Frees the buffer pointed to by `data` if `datalen` is non-0.
-pub extern "C" fn CVec_RouteHintZ_free(_res: CVec_RouteHintZ) { }
-impl Drop for CVec_RouteHintZ {
+pub extern "C" fn CVec_PrivateRouteZ_free(_res: CVec_PrivateRouteZ) { }
+impl Drop for CVec_PrivateRouteZ {
        fn drop(&mut self) {
                if self.datalen == 0 { return; }
                unsafe { Box::from_raw(std::slice::from_raw_parts_mut(self.data, self.datalen)) };
        }
 }
-impl Clone for CVec_RouteHintZ {
+impl Clone for CVec_PrivateRouteZ {
        fn clone(&self) -> Self {
                let mut res = Vec::new();
                if self.datalen == 0 { return Self::from(res); }
@@ -5454,50 +5454,50 @@ impl Clone for CResult_ExpiryTimeCreationErrorZ {
 /// but with all dynamically-allocated buffers duplicated in new buffers.
 pub extern "C" fn CResult_ExpiryTimeCreationErrorZ_clone(orig: &CResult_ExpiryTimeCreationErrorZ) -> CResult_ExpiryTimeCreationErrorZ { orig.clone() }
 #[repr(C)]
-/// The contents of CResult_RouteHintCreationErrorZ
-pub union CResult_RouteHintCreationErrorZPtr {
+/// The contents of CResult_PrivateRouteCreationErrorZ
+pub union CResult_PrivateRouteCreationErrorZPtr {
        /// A pointer to the contents in the success state.
        /// Reading from this pointer when `result_ok` is not set is undefined.
-       pub result: *mut crate::lightning_invoice::RouteHint,
+       pub result: *mut crate::lightning_invoice::PrivateRoute,
        /// A pointer to the contents in the error state.
        /// Reading from this pointer when `result_ok` is set is undefined.
        pub err: *mut crate::lightning_invoice::CreationError,
 }
 #[repr(C)]
-/// A CResult_RouteHintCreationErrorZ represents the result of a fallible operation,
-/// containing a crate::lightning_invoice::RouteHint on success and a crate::lightning_invoice::CreationError on failure.
+/// A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
+/// containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
 /// `result_ok` indicates the overall state, and the contents are provided via `contents`.
-pub struct CResult_RouteHintCreationErrorZ {
-       /// The contents of this CResult_RouteHintCreationErrorZ, accessible via either
+pub struct CResult_PrivateRouteCreationErrorZ {
+       /// The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
        /// `err` or `result` depending on the state of `result_ok`.
-       pub contents: CResult_RouteHintCreationErrorZPtr,
-       /// Whether this CResult_RouteHintCreationErrorZ represents a success state.
+       pub contents: CResult_PrivateRouteCreationErrorZPtr,
+       /// Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
        pub result_ok: bool,
 }
 #[no_mangle]
-/// Creates a new CResult_RouteHintCreationErrorZ in the success state.
-pub extern "C" fn CResult_RouteHintCreationErrorZ_ok(o: crate::lightning_invoice::RouteHint) -> CResult_RouteHintCreationErrorZ {
-       CResult_RouteHintCreationErrorZ {
-               contents: CResult_RouteHintCreationErrorZPtr {
+/// Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
+pub extern "C" fn CResult_PrivateRouteCreationErrorZ_ok(o: crate::lightning_invoice::PrivateRoute) -> CResult_PrivateRouteCreationErrorZ {
+       CResult_PrivateRouteCreationErrorZ {
+               contents: CResult_PrivateRouteCreationErrorZPtr {
                        result: Box::into_raw(Box::new(o)),
                },
                result_ok: true,
        }
 }
 #[no_mangle]
-/// Creates a new CResult_RouteHintCreationErrorZ in the error state.
-pub extern "C" fn CResult_RouteHintCreationErrorZ_err(e: crate::lightning_invoice::CreationError) -> CResult_RouteHintCreationErrorZ {
-       CResult_RouteHintCreationErrorZ {
-               contents: CResult_RouteHintCreationErrorZPtr {
+/// Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
+pub extern "C" fn CResult_PrivateRouteCreationErrorZ_err(e: crate::lightning_invoice::CreationError) -> CResult_PrivateRouteCreationErrorZ {
+       CResult_PrivateRouteCreationErrorZ {
+               contents: CResult_PrivateRouteCreationErrorZPtr {
                        err: Box::into_raw(Box::new(e)),
                },
                result_ok: false,
        }
 }
 #[no_mangle]
-/// Frees any resources used by the CResult_RouteHintCreationErrorZ.
-pub extern "C" fn CResult_RouteHintCreationErrorZ_free(_res: CResult_RouteHintCreationErrorZ) { }
-impl Drop for CResult_RouteHintCreationErrorZ {
+/// Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
+pub extern "C" fn CResult_PrivateRouteCreationErrorZ_free(_res: CResult_PrivateRouteCreationErrorZ) { }
+impl Drop for CResult_PrivateRouteCreationErrorZ {
        fn drop(&mut self) {
                if self.result_ok {
                        if unsafe { !(self.contents.result as *mut ()).is_null() } {
@@ -5510,16 +5510,16 @@ impl Drop for CResult_RouteHintCreationErrorZ {
                }
        }
 }
-impl From<crate::c_types::CResultTempl<crate::lightning_invoice::RouteHint, crate::lightning_invoice::CreationError>> for CResult_RouteHintCreationErrorZ {
-       fn from(mut o: crate::c_types::CResultTempl<crate::lightning_invoice::RouteHint, crate::lightning_invoice::CreationError>) -> Self {
+impl From<crate::c_types::CResultTempl<crate::lightning_invoice::PrivateRoute, crate::lightning_invoice::CreationError>> for CResult_PrivateRouteCreationErrorZ {
+       fn from(mut o: crate::c_types::CResultTempl<crate::lightning_invoice::PrivateRoute, crate::lightning_invoice::CreationError>) -> Self {
                let contents = if o.result_ok {
                        let result = unsafe { o.contents.result };
                        unsafe { o.contents.result = std::ptr::null_mut() };
-                       CResult_RouteHintCreationErrorZPtr { result }
+                       CResult_PrivateRouteCreationErrorZPtr { result }
                } else {
                        let err = unsafe { o.contents.err };
                        unsafe { o.contents.err = std::ptr::null_mut(); }
-                       CResult_RouteHintCreationErrorZPtr { err }
+                       CResult_PrivateRouteCreationErrorZPtr { err }
                };
                Self {
                        contents,
@@ -5527,23 +5527,23 @@ impl From<crate::c_types::CResultTempl<crate::lightning_invoice::RouteHint, crat
                }
        }
 }
-impl Clone for CResult_RouteHintCreationErrorZ {
+impl Clone for CResult_PrivateRouteCreationErrorZ {
        fn clone(&self) -> Self {
                if self.result_ok {
-                       Self { result_ok: true, contents: CResult_RouteHintCreationErrorZPtr {
-                               result: Box::into_raw(Box::new(<crate::lightning_invoice::RouteHint>::clone(unsafe { &*self.contents.result })))
+                       Self { result_ok: true, contents: CResult_PrivateRouteCreationErrorZPtr {
+                               result: Box::into_raw(Box::new(<crate::lightning_invoice::PrivateRoute>::clone(unsafe { &*self.contents.result })))
                        } }
                } else {
-                       Self { result_ok: false, contents: CResult_RouteHintCreationErrorZPtr {
+                       Self { result_ok: false, contents: CResult_PrivateRouteCreationErrorZPtr {
                                err: Box::into_raw(Box::new(<crate::lightning_invoice::CreationError>::clone(unsafe { &*self.contents.err })))
                        } }
                }
        }
 }
 #[no_mangle]
-/// Creates a new CResult_RouteHintCreationErrorZ which has the same data as `orig`
+/// Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
 /// but with all dynamically-allocated buffers duplicated in new buffers.
-pub extern "C" fn CResult_RouteHintCreationErrorZ_clone(orig: &CResult_RouteHintCreationErrorZ) -> CResult_RouteHintCreationErrorZ { orig.clone() }
+pub extern "C" fn CResult_PrivateRouteCreationErrorZ_clone(orig: &CResult_PrivateRouteCreationErrorZ) -> CResult_PrivateRouteCreationErrorZ { orig.clone() }
 #[repr(C)]
 /// The contents of CResult_StringErrorZ
 pub union CResult_StringErrorZPtr {
index d2704fa042968e6fd3db6142ac6f342edc9829bf..4879e7f6aacf660d4ff43838ddf6474e25cbc355 100644 (file)
@@ -272,7 +272,7 @@ use lightning::chain::Confirm as rustConfirm;
 impl rustConfirm for Confirm {
        fn transactions_confirmed(&self, mut header: &bitcoin::blockdata::block::BlockHeader, mut txdata: &lightning::chain::transaction::TransactionData, mut height: u32) {
                let mut local_header = { let mut s = [0u8; 80]; s[..].copy_from_slice(&::bitcoin::consensus::encode::serialize(header)); s };
-               let mut local_txdata = Vec::new(); for item in txdata.iter() { local_txdata.push( { let (mut orig_txdata_0_0, mut orig_txdata_0_1) = *item; let mut local_txdata_0 = (orig_txdata_0_0, crate::c_types::Transaction::from_bitcoin(&orig_txdata_0_1)).into(); local_txdata_0 }); };
+               let mut local_txdata = Vec::new(); for item in txdata.iter() { local_txdata.push( { let (mut orig_txdata_0_0, mut orig_txdata_0_1) = item; let mut local_txdata_0 = (orig_txdata_0_0, crate::c_types::Transaction::from_bitcoin(&orig_txdata_0_1)).into(); local_txdata_0 }); };
                (self.transactions_confirmed)(self.this_arg, &local_header, local_txdata.into(), height)
        }
        fn transaction_unconfirmed(&self, mut txid: &bitcoin::hash_types::Txid) {
index 5ee9614f1488fe203e90845994b8eebe5caba9a9..7022f5033802ab34eb06a9067bba740b0691df37 100644 (file)
@@ -287,10 +287,83 @@ pub extern "C" fn Route_read(ser: crate::c_types::u8slice) -> crate::c_types::de
        local_res
 }
 
+use lightning::routing::router::RouteHint as nativeRouteHintImport;
+type nativeRouteHint = nativeRouteHintImport;
+
+/// A list of hops along a payment path terminating with a channel to the recipient.
+#[must_use]
+#[repr(C)]
+pub struct RouteHint {
+       /// A pointer to the opaque Rust object.
+
+       /// Nearly everywhere, inner must be non-null, however in places where
+       /// the Rust equivalent takes an Option, it may be set to null to indicate None.
+       pub inner: *mut nativeRouteHint,
+       /// Indicates that this is the only struct which contains the same pointer.
+
+       /// Rust functions which take ownership of an object provided via an argument require
+       /// this to be true and invalidate the object pointed to by inner.
+       pub is_owned: bool,
+}
+
+impl Drop for RouteHint {
+       fn drop(&mut self) {
+               if self.is_owned && !<*mut nativeRouteHint>::is_null(self.inner) {
+                       let _ = unsafe { Box::from_raw(self.inner) };
+               }
+       }
+}
+/// Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
+#[no_mangle]
+pub extern "C" fn RouteHint_free(this_obj: RouteHint) { }
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+extern "C" fn RouteHint_free_void(this_ptr: *mut c_void) {
+       unsafe { let _ = Box::from_raw(this_ptr as *mut nativeRouteHint); }
+}
+#[allow(unused)]
+/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
+impl RouteHint {
+       pub(crate) fn take_inner(mut self) -> *mut nativeRouteHint {
+               assert!(self.is_owned);
+               let ret = self.inner;
+               self.inner = std::ptr::null_mut();
+               ret
+       }
+}
+/// Checks if two RouteHints contain equal inner contents.
+/// This ignores pointers and is_owned flags and looks at the values in fields.
+/// Two objects with NULL inner values will be considered "equal" here.
+#[no_mangle]
+pub extern "C" fn RouteHint_eq(a: &RouteHint, b: &RouteHint) -> bool {
+       if a.inner == b.inner { return true; }
+       if a.inner.is_null() || b.inner.is_null() { return false; }
+       if unsafe { &*a.inner } == unsafe { &*b.inner } { true } else { false }
+}
+impl Clone for RouteHint {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if <*mut nativeRouteHint>::is_null(self.inner) { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
+                       is_owned: true,
+               }
+       }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn RouteHint_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRouteHint)).clone() })) as *mut c_void
+}
+#[no_mangle]
+/// Creates a copy of the RouteHint
+pub extern "C" fn RouteHint_clone(orig: &RouteHint) -> RouteHint {
+       orig.clone()
+}
+
 use lightning::routing::router::RouteHintHop as nativeRouteHintHopImport;
 type nativeRouteHintHop = nativeRouteHintHopImport;
 
-/// A channel descriptor which provides a last-hop route to get_route
+/// A channel descriptor for a hop along a payment path.
 #[must_use]
 #[repr(C)]
 pub struct RouteHintHop {
@@ -449,8 +522,8 @@ pub extern "C" fn RouteHintHop_clone(orig: &RouteHintHop) -> RouteHintHop {
 /// If the payee provided features in their invoice, they should be provided via payee_features.
 /// Without this, MPP will only be used if the payee's features are available in the network graph.
 ///
-/// Extra routing hops between known nodes and the target will be used if they are included in
-/// last_hops.
+/// Private routing paths between a public node and the target may be included in `last_hops`.
+/// Currently, only the last hop in each path is considered.
 ///
 /// If some channels aren't announced, it may be useful to fill in a first_hops with the
 /// results from a local ChannelManager::list_usable_channels() call. If it is filled in, our
@@ -464,7 +537,7 @@ pub extern "C" fn RouteHintHop_clone(orig: &RouteHintHop) -> RouteHintHop {
 /// equal), however the enabled/disabled bit on such channels as well as the
 /// htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
 #[no_mangle]
-pub extern "C" fn get_route(mut our_node_id: crate::c_types::PublicKey, network: &crate::lightning::routing::network_graph::NetworkGraph, mut payee: crate::c_types::PublicKey, mut payee_features: crate::lightning::ln::features::InvoiceFeatures, first_hops: *mut crate::c_types::derived::CVec_ChannelDetailsZ, mut last_hops: crate::c_types::derived::CVec_RouteHintHopZ, mut final_value_msat: u64, mut final_cltv: u32, mut logger: crate::lightning::util::logger::Logger) -> crate::c_types::derived::CResult_RouteLightningErrorZ {
+pub extern "C" fn get_route(mut our_node_id: crate::c_types::PublicKey, network: &crate::lightning::routing::network_graph::NetworkGraph, mut payee: crate::c_types::PublicKey, mut payee_features: crate::lightning::ln::features::InvoiceFeatures, first_hops: *mut crate::c_types::derived::CVec_ChannelDetailsZ, mut last_hops: crate::c_types::derived::CVec_RouteHintZ, mut final_value_msat: u64, mut final_cltv: u32, mut logger: crate::lightning::util::logger::Logger) -> crate::c_types::derived::CResult_RouteLightningErrorZ {
        let mut local_payee_features = if payee_features.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(payee_features.take_inner()) } }) };
        let mut local_first_hops_base = if first_hops == std::ptr::null_mut() { None } else { Some( { let mut local_first_hops_0 = Vec::new(); for mut item in unsafe { &mut *first_hops }.as_slice().iter() { local_first_hops_0.push( { unsafe { &*item.inner } }); }; local_first_hops_0 }) }; let mut local_first_hops = local_first_hops_base.as_ref().map(|a| &a[..]);
        let mut local_last_hops = Vec::new(); for mut item in last_hops.as_slice().iter() { local_last_hops.push( { unsafe { &*item.inner } }); };
index d4e2e85cb2843983fb7193a8fb9a7e1c8d4d7357..a82129125c1e8e8fdc43ca78fceda8d5a8011cb8 100644 (file)
@@ -36,7 +36,7 @@ pub static TAG_MIN_FINAL_CLTV_EXPIRY: u8 = lightning_invoice::constants::TAG_MIN
 pub static TAG_FALLBACK: u8 = lightning_invoice::constants::TAG_FALLBACK;
 
 #[no_mangle]
-pub static TAG_ROUTE: u8 = lightning_invoice::constants::TAG_ROUTE;
+pub static TAG_PRIVATE_ROUTE: u8 = lightning_invoice::constants::TAG_PRIVATE_ROUTE;
 
 #[no_mangle]
 pub static TAG_PAYMENT_SECRET: u8 = lightning_invoice::constants::TAG_PAYMENT_SECRET;
index ef1bb7b4672a0bfea4de67777cb0763a99147627..eaa9aabbbc9258bb3d3dbe204f679b6fa695ea52 100644 (file)
@@ -1249,8 +1249,8 @@ pub extern "C" fn InvoiceSignature_clone(orig: &InvoiceSignature) -> InvoiceSign
        orig.clone()
 }
 
-use lightning_invoice::RouteHint as nativeRouteHintImport;
-type nativeRouteHint = nativeRouteHintImport;
+use lightning_invoice::PrivateRoute as nativePrivateRouteImport;
+type nativePrivateRoute = nativePrivateRouteImport;
 
 /// Private routing information
 ///
@@ -1259,12 +1259,12 @@ type nativeRouteHint = nativeRouteHintImport;
 ///
 #[must_use]
 #[repr(C)]
-pub struct RouteHint {
+pub struct PrivateRoute {
        /// A pointer to the opaque Rust object.
 
        /// Nearly everywhere, inner must be non-null, however in places where
        /// the Rust equivalent takes an Option, it may be set to null to indicate None.
-       pub inner: *mut nativeRouteHint,
+       pub inner: *mut nativePrivateRoute,
        /// Indicates that this is the only struct which contains the same pointer.
 
        /// Rust functions which take ownership of an object provided via an argument require
@@ -1272,44 +1272,44 @@ pub struct RouteHint {
        pub is_owned: bool,
 }
 
-impl Drop for RouteHint {
+impl Drop for PrivateRoute {
        fn drop(&mut self) {
-               if self.is_owned && !<*mut nativeRouteHint>::is_null(self.inner) {
+               if self.is_owned && !<*mut nativePrivateRoute>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
 }
-/// Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
+/// Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
 #[no_mangle]
-pub extern "C" fn RouteHint_free(this_obj: RouteHint) { }
+pub extern "C" fn PrivateRoute_free(this_obj: PrivateRoute) { }
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
-extern "C" fn RouteHint_free_void(this_ptr: *mut c_void) {
-       unsafe { let _ = Box::from_raw(this_ptr as *mut nativeRouteHint); }
+extern "C" fn PrivateRoute_free_void(this_ptr: *mut c_void) {
+       unsafe { let _ = Box::from_raw(this_ptr as *mut nativePrivateRoute); }
 }
 #[allow(unused)]
 /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy
-impl RouteHint {
-       pub(crate) fn take_inner(mut self) -> *mut nativeRouteHint {
+impl PrivateRoute {
+       pub(crate) fn take_inner(mut self) -> *mut nativePrivateRoute {
                assert!(self.is_owned);
                let ret = self.inner;
                self.inner = std::ptr::null_mut();
                ret
        }
 }
-/// Checks if two RouteHints contain equal inner contents.
+/// Checks if two PrivateRoutes contain equal inner contents.
 /// This ignores pointers and is_owned flags and looks at the values in fields.
 /// Two objects with NULL inner values will be considered "equal" here.
 #[no_mangle]
-pub extern "C" fn RouteHint_eq(a: &RouteHint, b: &RouteHint) -> bool {
+pub extern "C" fn PrivateRoute_eq(a: &PrivateRoute, b: &PrivateRoute) -> bool {
        if a.inner == b.inner { return true; }
        if a.inner.is_null() || b.inner.is_null() { return false; }
        if unsafe { &*a.inner } == unsafe { &*b.inner } { true } else { false }
 }
-impl Clone for RouteHint {
+impl Clone for PrivateRoute {
        fn clone(&self) -> Self {
                Self {
-                       inner: if <*mut nativeRouteHint>::is_null(self.inner) { std::ptr::null_mut() } else {
+                       inner: if <*mut nativePrivateRoute>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -1317,12 +1317,12 @@ impl Clone for RouteHint {
 }
 #[allow(unused)]
 /// Used only if an object of this type is returned as a trait impl by a method
-pub(crate) extern "C" fn RouteHint_clone_void(this_ptr: *const c_void) -> *mut c_void {
-       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRouteHint)).clone() })) as *mut c_void
+pub(crate) extern "C" fn PrivateRoute_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePrivateRoute)).clone() })) as *mut c_void
 }
 #[no_mangle]
-/// Creates a copy of the RouteHint
-pub extern "C" fn RouteHint_clone(orig: &RouteHint) -> RouteHint {
+/// Creates a copy of the PrivateRoute
+pub extern "C" fn PrivateRoute_clone(orig: &PrivateRoute) -> PrivateRoute {
        orig.clone()
 }
 /// Disassembles the `SignedRawInvoice` into its three parts:
@@ -1453,9 +1453,9 @@ pub extern "C" fn RawInvoice_features(this_arg: &RawInvoice) -> crate::lightning
 
 #[must_use]
 #[no_mangle]
-pub extern "C" fn RawInvoice_routes(this_arg: &RawInvoice) -> crate::c_types::derived::CVec_RouteHintZ {
-       let mut ret = unsafe { &*this_arg.inner }.routes();
-       let mut local_ret = Vec::new(); for mut item in ret.drain(..) { local_ret.push( { crate::lightning_invoice::RouteHint { inner: unsafe { ( (&(**item) as *const _) as *mut _) }, is_owned: false } }); };
+pub extern "C" fn RawInvoice_private_routes(this_arg: &RawInvoice) -> crate::c_types::derived::CVec_PrivateRouteZ {
+       let mut ret = unsafe { &*this_arg.inner }.private_routes();
+       let mut local_ret = Vec::new(); for mut item in ret.drain(..) { local_ret.push( { crate::lightning_invoice::PrivateRoute { inner: unsafe { ( (&(*item) as *const _) as *mut _) }, is_owned: false } }); };
        local_ret.into()
 }
 
@@ -1529,7 +1529,7 @@ pub extern "C" fn Invoice_check_signature(this_arg: &Invoice) -> crate::c_types:
        local_ret
 }
 
-/// Constructs an `Invoice` from a `SignedInvoice` by checking all its invariants.
+/// Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
 /// ```
 /// use lightning_invoice::*;
 ///
@@ -1621,9 +1621,18 @@ pub extern "C" fn Invoice_min_final_cltv_expiry(this_arg: &Invoice) -> u64 {
 /// Returns a list of all routes included in the invoice
 #[must_use]
 #[no_mangle]
-pub extern "C" fn Invoice_routes(this_arg: &Invoice) -> crate::c_types::derived::CVec_RouteHintZ {
-       let mut ret = unsafe { &*this_arg.inner }.routes();
-       let mut local_ret = Vec::new(); for mut item in ret.drain(..) { local_ret.push( { crate::lightning_invoice::RouteHint { inner: unsafe { ( (&(**item) as *const _) as *mut _) }, is_owned: false } }); };
+pub extern "C" fn Invoice_private_routes(this_arg: &Invoice) -> crate::c_types::derived::CVec_PrivateRouteZ {
+       let mut ret = unsafe { &*this_arg.inner }.private_routes();
+       let mut local_ret = Vec::new(); for mut item in ret.drain(..) { local_ret.push( { crate::lightning_invoice::PrivateRoute { inner: unsafe { ( (&(*item) as *const _) as *mut _) }, is_owned: false } }); };
+       local_ret.into()
+}
+
+/// Returns a list of all routes included in the invoice as the underlying hints
+#[must_use]
+#[no_mangle]
+pub extern "C" fn Invoice_route_hints(this_arg: &Invoice) -> crate::c_types::derived::CVec_RouteHintZ {
+       let mut ret = unsafe { &*this_arg.inner }.route_hints();
+       let mut local_ret = Vec::new(); for mut item in ret.drain(..) { local_ret.push( { crate::lightning::routing::router::RouteHint { inner: unsafe { ( (&(*item) as *const _) as *mut _) }, is_owned: false } }); };
        local_ret.into()
 }
 
@@ -1702,23 +1711,21 @@ pub extern "C" fn ExpiryTime_as_duration(this_arg: &ExpiryTime) -> u64 {
        ret.as_secs()
 }
 
-/// Create a new (partial) route from a list of hops
+/// Creates a new (partial) route from a list of hops
 #[must_use]
 #[no_mangle]
-pub extern "C" fn RouteHint_new(mut hops: crate::c_types::derived::CVec_RouteHintHopZ) -> crate::c_types::derived::CResult_RouteHintCreationErrorZ {
-       let mut local_hops = Vec::new(); for mut item in hops.into_rust().drain(..) { local_hops.push( { *unsafe { Box::from_raw(item.take_inner()) } }); };
-       let mut ret = lightning_invoice::RouteHint::new(local_hops);
-       let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning_invoice::RouteHint { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning_invoice::CreationError::native_into(e) }).into() };
+pub extern "C" fn PrivateRoute_new(mut hops: crate::lightning::routing::router::RouteHint) -> crate::c_types::derived::CResult_PrivateRouteCreationErrorZ {
+       let mut ret = lightning_invoice::PrivateRoute::new(*unsafe { Box::from_raw(hops.take_inner()) });
+       let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::lightning_invoice::PrivateRoute { inner: Box::into_raw(Box::new(o)), is_owned: true } }).into(), Err(mut e) => crate::c_types::CResultTempl::err( { crate::lightning_invoice::CreationError::native_into(e) }).into() };
        local_ret
 }
 
-/// Returrn the underlying vector of hops
+/// Returns the underlying list of hops
 #[must_use]
 #[no_mangle]
-pub extern "C" fn RouteHint_into_inner(mut this_arg: RouteHint) -> crate::c_types::derived::CVec_RouteHintHopZ {
+pub extern "C" fn PrivateRoute_into_inner(mut this_arg: PrivateRoute) -> crate::lightning::routing::router::RouteHint {
        let mut ret = (*unsafe { Box::from_raw(this_arg.take_inner()) }).into_inner();
-       let mut local_ret = Vec::new(); for mut item in ret.drain(..) { local_ret.push( { crate::lightning::routing::router::RouteHintHop { inner: Box::into_raw(Box::new(item)), is_owned: true } }); };
-       local_ret.into()
+       crate::lightning::routing::router::RouteHint { inner: Box::into_raw(Box::new(ret)), is_owned: true }
 }
 
 /// Errors that may occur when constructing a new `RawInvoice` or `Invoice`