File tree Expand file tree Collapse file tree
orange-sdk/src/trusted_wallet/cashu Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,15 +180,20 @@ impl CashuKvDatabase {
180180 }
181181
182182 async fn load_caches ( & self ) -> Result < ( ) , DatabaseError > {
183- // Load mints cache
184- if let Ok ( mints) = self . load_mints_from_store ( ) . await {
183+ // These use independent namespaces and can be restored concurrently. This
184+ // lets remote stores pipeline the requests while synchronous stores retain
185+ // their existing behavior.
186+ let ( mints, proofs) =
187+ tokio:: join!( self . load_mints_from_store( ) , self . load_proofs_from_store( ) ) ;
188+
189+ if let Ok ( mints) = mints {
185190 let mut cache = self . mints_cache . write ( ) . unwrap ( ) ;
186191 * cache = mints;
187192 }
188193
189194 // Proof errors must not be hidden: presenting an empty cache for an unreadable
190195 // proof set could make the wallet report an incorrect balance.
191- let proofs = self . load_proofs_from_store ( ) . await ?;
196+ let proofs = proofs ?;
192197 let mut cache = self . proofs_cache . write ( ) . unwrap ( ) ;
193198 * cache = proofs;
194199
You can’t perform that action at this time.
0 commit comments