mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 21:17:16 +00:00
26 lines
473 B
Go
26 lines
473 B
Go
package node
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/ledgerwatch/erigon/common/dbutils"
|
|
)
|
|
|
|
//nolint
|
|
func prepareBuckets(customBuckets dbutils.BucketsCfg) {
|
|
if len(customBuckets) == 0 {
|
|
return
|
|
}
|
|
|
|
currentBuckets := dbutils.DefaultBuckets()
|
|
|
|
for k, v := range customBuckets {
|
|
if _, ok := currentBuckets[k]; ok {
|
|
panic(fmt.Errorf("overriding existing buckets is not supported (bucket key=%s)", k))
|
|
}
|
|
currentBuckets[k] = v
|
|
}
|
|
|
|
dbutils.UpdateBucketsList(currentBuckets)
|
|
}
|