From 61f3b55e954cfa8915cafb0d77561130d50be7de Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 28 Jul 2022 05:40:56 +0000 Subject: [PATCH] [Java] Add a simple read lock call in HumanObjectPeerTest --- src/test/java/org/ldk/HumanObjectPeerTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/ldk/HumanObjectPeerTest.java b/src/test/java/org/ldk/HumanObjectPeerTest.java index 751f198f..70f57796 100644 --- a/src/test/java/org/ldk/HumanObjectPeerTest.java +++ b/src/test/java/org/ldk/HumanObjectPeerTest.java @@ -399,7 +399,11 @@ class HumanObjectPeerTestInstance { this.payer = InvoicePayer.of(this.chan_manager.as_Payer(), Router.new_impl(new Router.RouterInterface() { @Override public Result_RouteLightningErrorZ find_route(byte[] payer, RouteParameters params, byte[] payment_hash, ChannelDetails[] first_hops, Score scorer) { - return UtilMethods.find_route(payer, params, router, first_hops, logger, scorer, new byte[32]); + // Take a read lock on the NetworkGraph just to make sure we even can. + try (ReadOnlyNetworkGraph graph = router.read_only()) { + assert graph.channel(424242) == null; + return UtilMethods.find_route(payer, params, router, first_hops, logger, scorer, new byte[32]); + } } }), MultiThreadedLockableScore.of(Score.new_impl(new Score.ScoreInterface() { @Override public void payment_path_failed(RouteHop[] path, long scid) {} -- 2.39.5