- // Takes in a path to have its information stored in `payment_cache`. This is done for paths
- // that are pending retry.
- fn process_path_inflight_htlcs(&self, payment_hash: PaymentHash, path: Vec<RouteHop>) {
- self.payment_cache.lock().unwrap().entry(payment_hash)
- .or_insert_with(|| PaymentInfo::new())
- .paths.push(path);
- }
-
- // Find the path we want to remove in `payment_cache`. If it doesn't exist, do nothing.
- fn remove_path_inflight_htlcs(&self, payment_hash: PaymentHash, path: &Vec<RouteHop>) {
- self.payment_cache.lock().unwrap().entry(payment_hash)
- .and_modify(|payment_info| {
- if let Some(idx) = payment_info.paths.iter().position(|p| p == path) {
- payment_info.paths.swap_remove(idx);
- }
- });
- }
-