]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Merge pull request #1625 from TheBlueMatt/2022-07-history-tracking
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Fri, 7 Oct 2022 16:32:10 +0000 (16:32 +0000)
committerGitHub <noreply@github.com>
Fri, 7 Oct 2022 16:32:10 +0000 (16:32 +0000)
1  2 
lightning/src/routing/scoring.rs
lightning/src/util/ser.rs

index 3030c930818e631aae705e785dfa6afdfb56fa70,73bbbe460e159378e00d12b6f41a3685bbefc1bb..d1195dc8d674b343fcb769f9490724e4a4c14d21
@@@ -750,16 -954,14 +982,16 @@@ impl<L: Deref<Target = u64>, BRT: Deref
        }
  }
  
- impl<L: DerefMut<Target = u64>, T: Time, U: DerefMut<Target = T>> DirectedChannelLiquidity<L, T, U> {
+ impl<L: DerefMut<Target = u64>, BRT: DerefMut<Target = HistoricalBucketRangeTracker>, T: Time, U: DerefMut<Target = T>> DirectedChannelLiquidity<'_, L, BRT, T, U> {
        /// Adjusts the channel liquidity balance bounds when failing to route `amount_msat`.
        fn failed_at_channel<Log: Deref>(&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);
                }
        }
  
Simple merge