| … | … | @@ -225,8 +225,15 @@ async function _initializeStorage(identity) { |
| 225 | 225 | // Join discovery key for this wallet |
| 226 | 226 | const discoveryKey = crypto.discoveryKey(identityKeyPair.publicKey) |
| 227 | 227 | const discovery = swarm.join(discoveryKey, { server: true, client: true }) |
| 228 | | await discovery.flushed() |
| 229 | 228 | |
| 229 | // Flush in background - don't block initialization on DHT announcement |
| 230 | discovery.flushed().then(() => { |
| 231 | console.log('📡 DHT discovery announced') |
| 232 | }).catch(err => { |
| 233 | console.warn('⚠️ DHT discovery flush failed:', err.message) |
| 234 | }) |
| 235 | |
| 236 | console.log('✅ Storage initialized successfully') |
| 230 | 237 | return { store, autobase, txHistoryDb, swarm } |
| 231 | 238 | } |
| 232 | 239 | |