This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): fix geth --init temp dir race condition (#2068)
* fix(core): fix geth --init temp dir race condition * previously, if multiple instances of geth were spawned concurrently, only one directory would be used to populate geth's genesis.json. this can lead to a race condition where the genesis.json would be re-written by a second instance, before the first instance reads the genesis.json for populating its db and genesis block with the geth --init command. this was possible because directory returned by std::env::temp_dir() is often shared * fixes the race condition by using tempfile::tempdir(), which creates a unique directory per call to tempdir() * only use tempfile on non-wasm32
- Loading branch information