X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fdemo.cpp;h=252bae5e294205e2085df4b6c373db33270165db;hb=e1dd5fa811b8fecf0e0abdd6c7280a94489cc7b9;hp=7c56dd769aae1eb4670bf66732c458e3e5bcab59;hpb=12da50613933d348dd5b924999af72708838190c;p=ldk-c-bindings diff --git a/lightning-c-bindings/demo.cpp b/lightning-c-bindings/demo.cpp index 7c56dd7..252bae5 100644 --- a/lightning-c-bindings/demo.cpp +++ b/lightning-c-bindings/demo.cpp @@ -482,7 +482,7 @@ uint64_t get_chan_score(const void *this_arg, uint64_t scid, const LDKNodeId *sr return 42; } -struct LDKCResult_RouteLightningErrorZ custom_find_route(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKInFlightHtlcs *in_flights) { +struct LDKCResult_RouteLightningErrorZ custom_find_route(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKInFlightHtlcs *in_flights, LDKThirtyTwoBytes payment_id, LDKThirtyTwoBytes payment_hash) { const LDK::DefaultRouter *router = (LDK::DefaultRouter *)this_arg; assert(first_hops->datalen == 1); assert(ChannelDetails_get_is_usable(&first_hops->data[0])); @@ -553,6 +553,7 @@ int main() { LDKRouter panic_router = { .this_arg = NULL, .find_route = NULL, // Segfault if we ever try to find a route + .find_route_with_id = NULL, // Segfault if we ever try to find a route .free = NULL, }; @@ -898,7 +899,8 @@ int main() { const LDK::DefaultRouter default_router_1 = DefaultRouter_new(&net_graph1, logger1, entropy_source1.get_secure_random_bytes(), std::move(scorer_mtx_trait1)); LDKRouter router1 = { .this_arg = (void*)&default_router_1, - .find_route = custom_find_route, + .find_route = NULL, // LDK currently doesn't use this, its just a default-impl + .find_route_with_id = custom_find_route, .free = NULL, };