Skip to content

Commit 2a8f98f

Browse files
authored
Merge pull request #111 from TheBlueMatt/main
2 parents af6f994 + 61f3b55 commit 2a8f98f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/test/java/org/ldk/HumanObjectPeerTest.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,11 @@ private void setup_route_handler() {
399399
this.payer = InvoicePayer.of(this.chan_manager.as_Payer(), Router.new_impl(new Router.RouterInterface() {
400400
@Override
401401
public Result_RouteLightningErrorZ find_route(byte[] payer, RouteParameters params, byte[] payment_hash, ChannelDetails[] first_hops, Score scorer) {
402-
return UtilMethods.find_route(payer, params, router, first_hops, logger, scorer, new byte[32]);
402+
// Take a read lock on the NetworkGraph just to make sure we even can.
403+
try (ReadOnlyNetworkGraph graph = router.read_only()) {
404+
assert graph.channel(424242) == null;
405+
return UtilMethods.find_route(payer, params, router, first_hops, logger, scorer, new byte[32]);
406+
}
403407
}
404408
}), MultiThreadedLockableScore.of(Score.new_impl(new Score.ScoreInterface() {
405409
@Override public void payment_path_failed(RouteHop[] path, long scid) {}
@@ -1054,7 +1058,9 @@ void do_test_message_handler_b(TestState state) throws InterruptedException {
10541058
// so we cannot exchange custom messages with it
10551059
if (!use_chan_manager_constructor) {
10561060
byte[] custom_message_bytes = new byte[]{0x42, 0x44, 0x43, 0x00};
1057-
state.peer1.custom_messages_to_send.add(custom_message_bytes);
1061+
synchronized(state.peer1.custom_messages_to_send) {
1062+
state.peer1.custom_messages_to_send.add(custom_message_bytes);
1063+
}
10581064
state.peer1.peer_manager.process_events();
10591065
synchronized (state.peer2.received_custom_messages) {
10601066
while (true) {

0 commit comments

Comments
 (0)