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

Method fresh_prices

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

Source from the content-addressed store, hash-verified

213 }
214
215 fn fresh_prices(&self) -> Vec<SourceResult> {
216 self.prices
217 .iter()
218 .filter(|(_, p)| p.timestamp + SERVE_TTL > Instant::now())
219 .map(|(n, p)| SourceResult {
220 name: n.clone(),
221 price: p.price,
222 })
223 .collect()
224 }
225
226 fn is_drift_ok(&self) -> bool {
227 let mut cache_sorted_by_recency: Vec<(&String, &PriceCache)> = self.prices.iter().collect();

Callers 1

get_median_rateMethod · 0.80

Calls 2

mapMethod · 0.80
filterMethod · 0.80

Tested by

no test coverage detected