fix: Copy cache pointer on RPC client reset

The disappearing cache was the result of creating a new smart pointer
to a new cache every time the RPC client was switched. Fixed by
cloning the smart pointer to the cache whenever the RPC client gets
reset.

No need for persistence.
This commit is contained in:
Alan Szepieniec 2025-08-13 22:26:48 +02:00
parent c7be96a52c
commit 35506534f7

View File

@ -92,7 +92,7 @@ impl AppState {
rpc_client,
config: inner.config.clone(),
genesis_digest: inner.genesis_digest,
transparent_utxos_cache: Arc::new(Mutex::new(vec![])),
transparent_utxos_cache: inner.transparent_utxos_cache.clone(),
};
self.0.store(Arc::new(new_inner));
}