core, cmd, vendor: fixes and database inspection tool (#15)
* core, eth: some fixes for freezer * vendor, core/rawdb, cmd/geth: add db inspector * core, cmd/utils: check ancient store path forceily * cmd/geth, common, core/rawdb: a few fixes * cmd/geth: support windows file rename and fix rename error * core: support ancient plugin * core, cmd: streaming file copy * cmd, consensus, core, tests: keep genesis in leveldb * core: write txlookup during ancient init * core: bump database version
This commit is contained in:
committed by
Péter Szilágyi
parent
42c746d6f4
commit
37d280da41
@@ -80,6 +80,20 @@ func WriteChainConfig(db ethdb.KeyValueWriter, hash common.Hash, cfg *params.Cha
|
||||
}
|
||||
}
|
||||
|
||||
// ReadAncientPath retrieves ancient database path which is recorded during the
|
||||
// first node setup or forcibly changed by user.
|
||||
func ReadAncientPath(db ethdb.KeyValueReader) string {
|
||||
data, _ := db.Get(ancientKey)
|
||||
return string(data)
|
||||
}
|
||||
|
||||
// WriteAncientPath writes ancient database path into the key-value database.
|
||||
func WriteAncientPath(db ethdb.KeyValueWriter, path string) {
|
||||
if err := db.Put(ancientKey, []byte(path)); err != nil {
|
||||
log.Crit("Failed to store ancient path", "err", err)
|
||||
}
|
||||
}
|
||||
|
||||
// ReadPreimage retrieves a single preimage of the provided hash.
|
||||
func ReadPreimage(db ethdb.KeyValueReader, hash common.Hash) []byte {
|
||||
data, _ := db.Get(preimageKey(hash))
|
||||
|
Reference in New Issue
Block a user