v0.2.11-pre.008-fix.001
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-offchain-transport-lib/src/market_price_service.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
//! Generic market-price refresh service owning provider dispatch and availability transitions.
|
||||
|
||||
@@ -204,10 +204,10 @@ impl crate::MarketPriceService {
|
||||
availability: crate::MarketPriceProviderAvailability,
|
||||
) -> crate::MarketPriceProviderState {
|
||||
let mut guard = lock_registry(&self.registry);
|
||||
if guard.set_availability(provider_id, availability) {
|
||||
if let std::option::Option::Some(state) = guard.state(provider_id) {
|
||||
return state.clone();
|
||||
}
|
||||
if guard.set_availability(provider_id, availability)
|
||||
&& let std::option::Option::Some(state) = guard.state(provider_id)
|
||||
{
|
||||
return state.clone();
|
||||
}
|
||||
return crate::MarketPriceProviderState::new(provider_id.clone(), availability);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user