mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 09:37:38 +00:00
erigon22: auto create dir (#4911)
This commit is contained in:
parent
db0c4e9d41
commit
0d21da4a01
@ -17,6 +17,7 @@ import (
|
||||
"time"
|
||||
|
||||
libcommon "github.com/ledgerwatch/erigon-lib/common"
|
||||
"github.com/ledgerwatch/erigon-lib/common/dir"
|
||||
"github.com/ledgerwatch/erigon-lib/kv"
|
||||
kv2 "github.com/ledgerwatch/erigon-lib/kv/mdbx"
|
||||
libstate "github.com/ledgerwatch/erigon-lib/state"
|
||||
@ -312,6 +313,7 @@ func Erigon22(genesis *core.Genesis, logger log.Logger) error {
|
||||
return err
|
||||
}
|
||||
}
|
||||
dir.MustExist(reconDbPath)
|
||||
limiter := semaphore.NewWeighted(int64(runtime.NumCPU() + 1))
|
||||
db, err := kv2.NewMDBX(logger).Path(reconDbPath).RoTxsLimiter(limiter).Open()
|
||||
if err != nil {
|
||||
@ -401,10 +403,8 @@ func Erigon22(genesis *core.Genesis, logger log.Logger) error {
|
||||
} else if err = os.RemoveAll(aggDir); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = os.MkdirAll(aggDir, 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
dir.MustExist(reconDbPath)
|
||||
agg, err := libstate.NewAggregator22(aggDir, AggregationStep)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user