From: Matt Corallo <649246+TheBlueMatt@users.noreply.github.com> Date: Fri, 7 Oct 2022 16:32:10 +0000 (+0000) Subject: Merge pull request #1625 from TheBlueMatt/2022-07-history-tracking X-Git-Tag: v0.0.112~21 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=4cd990142780233d163b68f21ada293656ca6b54;p=rust-lightning Merge pull request #1625 from TheBlueMatt/2022-07-history-tracking --- 4cd990142780233d163b68f21ada293656ca6b54 diff --cc lightning/src/routing/scoring.rs index 3030c9308,73bbbe460..d1195dc8d --- a/lightning/src/routing/scoring.rs +++ b/lightning/src/routing/scoring.rs @@@ -750,16 -954,14 +982,16 @@@ impl, BRT: Deref } } - impl, T: Time, U: DerefMut> DirectedChannelLiquidity { + impl, BRT: DerefMut, T: Time, U: DerefMut> DirectedChannelLiquidity<'_, L, BRT, T, U> { /// Adjusts the channel liquidity balance bounds when failing to route `amount_msat`. fn failed_at_channel(&mut self, amount_msat: u64, chan_descr: fmt::Arguments, logger: &Log) where Log::Target: Logger { - if amount_msat < self.max_liquidity_msat() { - log_debug!(logger, "Setting max liquidity of {} to {}", chan_descr, amount_msat); + let existing_max_msat = self.max_liquidity_msat(); + if amount_msat < existing_max_msat { + log_debug!(logger, "Setting max liquidity of {} from {} to {}", chan_descr, existing_max_msat, amount_msat); self.set_max_liquidity_msat(amount_msat); } else { - log_trace!(logger, "Max liquidity of {} already more than {}", chan_descr, amount_msat); + log_trace!(logger, "Max liquidity of {} is {} (already less than or equal to {})", + chan_descr, existing_max_msat, amount_msat); } }