mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-24 15:02:20 +01:00
Fix deadlock in chanmon_consistency
fuzzer
bcaba29f92
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.
This commit is contained in:
parent
54725ceee4
commit
351d414457
1 changed files with 2 additions and 4 deletions
|
@ -552,8 +552,7 @@ fn send_payment(
|
||||||
.find(|chan| chan.short_channel_id == Some(dest_chan_id))
|
.find(|chan| chan.short_channel_id == Some(dest_chan_id))
|
||||||
.map(|chan| (chan.next_outbound_htlc_minimum_msat, chan.next_outbound_htlc_limit_msat))
|
.map(|chan| (chan.next_outbound_htlc_minimum_msat, chan.next_outbound_htlc_limit_msat))
|
||||||
.unwrap_or((0, 0));
|
.unwrap_or((0, 0));
|
||||||
let mut next_routes = source.router.next_routes.lock().unwrap();
|
source.router.next_routes.lock().unwrap().push_back(Route {
|
||||||
next_routes.push_back(Route {
|
|
||||||
paths: vec![Path {
|
paths: vec![Path {
|
||||||
hops: vec![RouteHop {
|
hops: vec![RouteHop {
|
||||||
pubkey: dest.get_our_node_id(),
|
pubkey: dest.get_our_node_id(),
|
||||||
|
@ -623,8 +622,7 @@ fn send_hop_payment(
|
||||||
.map(|chan| (chan.next_outbound_htlc_minimum_msat, chan.next_outbound_htlc_limit_msat))
|
.map(|chan| (chan.next_outbound_htlc_minimum_msat, chan.next_outbound_htlc_limit_msat))
|
||||||
.unwrap_or((0, 0));
|
.unwrap_or((0, 0));
|
||||||
let first_hop_fee = 50_000;
|
let first_hop_fee = 50_000;
|
||||||
let mut next_routes = source.router.next_routes.lock().unwrap();
|
source.router.next_routes.lock().unwrap().push_back(Route {
|
||||||
next_routes.push_back(Route {
|
|
||||||
paths: vec![Path {
|
paths: vec![Path {
|
||||||
hops: vec![
|
hops: vec![
|
||||||
RouteHop {
|
RouteHop {
|
||||||
|
|
Loading…
Add table
Reference in a new issue