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
Showing
2 changed files
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters