mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 19:50:36 +00:00
checkChangeSet to work with MDBX, load senders for better performance (#2024)
* CheckchangeSets switch to MDBX * Load senders Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
This commit is contained in:
parent
5a0afc0a72
commit
d5c2e5fd9a
@ -64,7 +64,11 @@ func CheckChangeSets(genesis *core.Genesis, blockNum uint64, chaindata string, h
|
||||
interruptCh <- true
|
||||
}()
|
||||
|
||||
chainDb := ethdb.MustOpen(chaindata)
|
||||
kv, err := ethdb.NewMDBX().Path(chaindata).Open()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
chainDb := ethdb.NewObjectDatabase(kv)
|
||||
defer chainDb.Close()
|
||||
historyDb := chainDb
|
||||
if chaindata != historyfile {
|
||||
@ -113,7 +117,11 @@ func CheckChangeSets(genesis *core.Genesis, blockNum uint64, chaindata string, h
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
block := rawdb.ReadBlock(rwtx, blockHash, blockNum)
|
||||
var block *types.Block
|
||||
block, _, err = rawdb.ReadBlockWithSenders(rwtx, blockHash, blockNum)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if block == nil {
|
||||
break
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user