From: Matt Corallo Date: Wed, 18 Jan 2023 00:01:15 +0000 (-0600) Subject: Use ProbabilisticScorer in router fuzzing, to cover overflows there X-Git-Tag: v0.0.114~1^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=dfe9ea3762aa21dfc2b5807147fe5975436d76d2;p=rust-lightning Use ProbabilisticScorer in router fuzzing, to cover overflows there --- diff --git a/fuzz/src/router.rs b/fuzz/src/router.rs index 4c228cc73..ad0da138a 100644 --- a/fuzz/src/router.rs +++ b/fuzz/src/router.rs @@ -17,7 +17,7 @@ use lightning::ln::msgs; use lightning::routing::gossip::{NetworkGraph, RoutingFees}; use lightning::routing::utxo::{UtxoFuture, UtxoLookup, UtxoLookupError, UtxoResult}; use lightning::routing::router::{find_route, PaymentParameters, RouteHint, RouteHintHop, RouteParameters}; -use lightning::routing::scoring::FixedPenaltyScorer; +use lightning::routing::scoring::ProbabilisticScorer; use lightning::util::config::UserConfig; use lightning::util::ser::Readable; @@ -292,7 +292,7 @@ pub fn do_test(data: &[u8], out: Out) { }])); } } - let scorer = FixedPenaltyScorer::with_penalty(0); + let scorer = ProbabilisticScorer::new(Default::default(), &net_graph, &logger); let random_seed_bytes: [u8; 32] = [get_slice!(1)[0]; 32]; for target in node_pks.iter() { let final_value_msat = slice_to_be64(get_slice!(8));