Skip to main content

register_loaded_currencies

Function register_loaded_currencies 

Source
pub fn register_loaded_currencies(
    currencies: &mut AHashMap<Ustr, Currency>,
) -> Result<()>
Expand description

Registers currencies loaded from a cache database, keeping the registry’s definition.

A Money or Currency decoded afterwards resolves its code through the global registry, so a loaded currency must reach it before the dependent payloads are read. Currency::register does not overwrite, so a built-in constant or a currency an adapter registered first keeps its definition; the map takes that definition too, so the cache and the decoded payloads agree, and a stored record that differs from it is logged.

§Errors

Returns an error if Currency::register does; it does not at present, so the result only keeps callers forward-compatible.