helium / blockchain-core

Apache License 2.0
214 stars 85 forks source link

Ledger lookup happens in spawn #1402

Closed jadeallenx closed 2 years ago

jadeallenx commented 2 years ago

Problem to solve: When autoload is set to false like in blockchain-etl, the call on line 394 blows up with a function clause error because the chain is still undefined.

Solution: Defer the ledger lookup until just before the cache generation happens and do it inside of the spawn, so that if it fails, it's harmless to application start up.