+ assert(scoring_fee_params != null);
+ DefaultRouter default_router = DefaultRouter.of(this.net_graph, logger, entropy_source, scorer.as_LockableScore(), scoring_fee_params);
+ if (router_wrapper != null) {
+ router = Router.new_impl(new Router.RouterInterface() {
+ @Override public Result_RouteLightningErrorZ find_route(byte[] payer, RouteParameters route_params, ChannelDetails[] first_hops, InFlightHtlcs inflight_htlcs) {
+ return router_wrapper.find_route(payer, route_params, first_hops, inflight_htlcs, null, null, default_router);
+ }
+ @Override public Result_RouteLightningErrorZ find_route_with_id(byte[] payer, RouteParameters route_params, ChannelDetails[] first_hops, InFlightHtlcs inflight_htlcs, byte[] payment_hash, byte[] payment_id) {
+ return router_wrapper.find_route(payer, route_params, first_hops, inflight_htlcs, payment_hash, payment_id, default_router);
+ }
+
+ @Override
+ public Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ create_blinded_payment_paths(byte[] recipient, ChannelDetails[] first_hops, ReceiveTlvs tlvs, long amount_msats) {
+ return default_router.as_Router().create_blinded_payment_paths(recipient, first_hops, tlvs, amount_msats);
+ }
+ }, new MessageRouter.MessageRouterInterface() {
+ @Override public Result_OnionMessagePathNoneZ find_path(byte[] sender, byte[][] peers, Destination destination) {
+ return default_router.as_MessageRouter().find_path(sender, peers, destination);
+ }
+ @Override public Result_CVec_BlindedPathZNoneZ create_blinded_paths(byte[] recipient, byte[][] peers) {
+ return default_router.as_MessageRouter().create_blinded_paths(recipient, peers);
+ }
+ });
+ } else {
+ router = default_router.as_Router();
+ }
+ channel_monitors = new TwoTuple_ThirtyTwoBytesChannelMonitorZ[0];