- // Send another payment, this time via the InvoicePayer
- LDK::ProbabilisticScorer scorer = ProbabilisticScorer_new(ProbabilisticScoringParameters_default(), &net_graph1, logger1);
- LDK::Score scorer_trait = ProbabilisticScorer_as_Score(&scorer);
- LDK::MultiThreadedLockableScore scorer_mtx = MultiThreadedLockableScore_new(std::move(scorer_trait));
- LDK::LockableScore scorer_mtx_trait = MultiThreadedLockableScore_as_LockableScore(&scorer_mtx);
- const LDK::DefaultRouter router = DefaultRouter_new(&net_graph1, logger1, keys_source1->get_secure_random_bytes(keys_source1->this_arg), std::move(scorer_mtx_trait));
- LDKRouter sending_router = {
- .this_arg = (void*)&router,
- .find_route = custom_find_route,
- .notify_payment_path_failed = custom_notify_payment_path_failed,
- .notify_payment_path_successful = custom_notify_payment_path_successful,
- // We don't probe, so we opt to crash if the probe functions are called.
- .notify_payment_probe_successful = NULL,
- .notify_payment_probe_failed = NULL,
- .free = NULL,
- };
- EventQueue queue1;
- LDKEventHandler handler1 = { .this_arg = &queue1, .handle_event = handle_event, .free = NULL };
- LDK::InvoicePayer payer = InvoicePayer_new(ChannelManager_as_Payer(&cm1), sending_router, logger1, handler1, Retry_attempts(0));
-