Skip to content

Commit 31b84fe

Browse files
committed
f cleanups and use utils more
1 parent d254510 commit 31b84fe

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lightning/src/routing/scoring.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -632,15 +632,15 @@ impl<G: Deref<Target = NetworkGraph>, L: Deref, T: Time> ProbabilisticScorerUsin
632632
let graph = self.network_graph.read_only();
633633
for (scid, liq) in self.channel_liquidities.iter() {
634634
if let Some(chan_debug) = graph.channels().get(scid) {
635-
let log_direction = |dir: &Option<ChannelUpdateInfo>, sender, recipient| {
635+
let log_direction = |dir: &Option<ChannelUpdateInfo>, source, target| {
636636
if let Some(dir_debug) = dir {
637-
let amount = chan_debug.capacity_sats.map(|v| v*1000).or(dir_debug.htlc_maximum_msat);
638-
if let Some(amt) = amount {
639-
let dir_liq = liq.as_directed(sender, recipient, amt, self.params.liquidity_offset_half_life);
637+
if let Some((directed_info, _)) = chan_debug.as_directed_to(target) {
638+
let amt = directed_info.effective_capacity().as_msat();
639+
let dir_liq = liq.as_directed(source, target, amt, self.params.liquidity_offset_half_life);
640640
log_debug!(self.logger, "Liquidity from {:?} to {:?} via {} is in the range ({}, {})",
641-
sender, recipient, scid, dir_liq.min_liquidity_msat(), dir_liq.max_liquidity_msat());
641+
source, target, scid, dir_liq.min_liquidity_msat(), dir_liq.max_liquidity_msat());
642642
} else {
643-
log_debug!(self.logger, "No amount known for SCID {} from {:?} to {:?}", scid, sender, recipient);
643+
log_debug!(self.logger, "No amount known for SCID {} from {:?} to {:?}", scid, source, target);
644644
}
645645
}
646646
};

0 commit comments

Comments
 (0)