Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

reuse same data directory if genesis is provided without privkey #176

Merged
merged 1 commit into from May 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/index.ts
Expand Up @@ -124,6 +124,13 @@ class LotionApp implements Application {
.update(fs.readFileSync(this.config.keyPath))
.digest('hex')
)
} else if (this.config.genesisPath && !this.config.keyPath) {
this.home = join(
this.lotionHome,
createHash('sha256')
.update(fs.readFileSync(this.config.genesisPath))
.digest('hex')
)
} else {
this.home = join(this.lotionHome, randomBytes(16).toString('hex'))
}
Expand Down