Skip to content

Commit

Permalink
Merge pull request #2072 from jkczyz/2023-01-fix-scoring-div-by-zero
Browse files Browse the repository at this point in the history
Fix division by zero in `ProbabilisticScorer`
  • Loading branch information
TheBlueMatt authored Mar 4, 2023
2 parents 0188861 + dfe9ea3 commit 4d2679f
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 63 deletions.
4 changes: 2 additions & 2 deletions fuzz/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -292,7 +292,7 @@ pub fn do_test<Out: test_logger::Output>(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));
Expand Down
Loading

0 comments on commit 4d2679f

Please sign in to comment.