MCPcopy Create free account
hub / github.com/ElementsProject/lightning / fresh_prices

Method fresh_prices

plugins/currencyrate-plugin/src/oracle.rs:182–191  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

180 }
181
182 fn fresh_prices(&self) -> Vec<SourceResult> {
183 self.prices
184 .iter()
185 .filter(|(_, p)| p.timestamp + SERVE_TTL > Instant::now())
186 .map(|(n, p)| SourceResult {
187 name: n.clone(),
188 price: p.price,
189 })
190 .collect()
191 }
192
193 fn is_drift_ok(&self) -> bool {
194 let mut cache_sorted_by_recency: Vec<(&String, &PriceCache)> = self.prices.iter().collect();

Callers 1

get_median_rateMethod · 0.80

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected