Skip to content

Commit 351d414

Browse files
committed
Fix deadlock in chanmon_consistency fuzzer
bcaba29 introduced a deadlock in the `chanmon_consistency` fuzzer by holding a lock on the route expectations before sending a payment, which ultimately tries to lock the route expectations. Here we fix this deadlock.
1 parent 54725ce commit 351d414

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,7 @@ fn send_payment(
552552
.find(|chan| chan.short_channel_id == Some(dest_chan_id))
553553
.map(|chan| (chan.next_outbound_htlc_minimum_msat, chan.next_outbound_htlc_limit_msat))
554554
.unwrap_or((0, 0));
555-
let mut next_routes = source.router.next_routes.lock().unwrap();
556-
next_routes.push_back(Route {
555+
source.router.next_routes.lock().unwrap().push_back(Route {
557556
paths: vec![Path {
558557
hops: vec![RouteHop {
559558
pubkey: dest.get_our_node_id(),
@@ -623,8 +622,7 @@ fn send_hop_payment(
623622
.map(|chan| (chan.next_outbound_htlc_minimum_msat, chan.next_outbound_htlc_limit_msat))
624623
.unwrap_or((0, 0));
625624
let first_hop_fee = 50_000;
626-
let mut next_routes = source.router.next_routes.lock().unwrap();
627-
next_routes.push_back(Route {
625+
source.router.next_routes.lock().unwrap().push_back(Route {
628626
paths: vec![Path {
629627
hops: vec![
630628
RouteHop {

0 commit comments

Comments
 (0)