mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-08 20:11:21 +00:00
fix print buckets issue
This commit is contained in:
parent
7464b7924d
commit
bb55ea81a4
@ -212,7 +212,7 @@ func SpawnExecuteBlocksStage(s *StageState, stateDB ethdb.Database, chainConfig
|
||||
if err = tx.CommitAndBegin(context.Background()); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = printBucketsSize(tx.(ethdb.HasTx).Tx()); err != nil {
|
||||
if err = printBucketsSize(tx); err != nil {
|
||||
return err
|
||||
}
|
||||
chainContext.SetDB(tx)
|
||||
@ -233,7 +233,7 @@ func SpawnExecuteBlocksStage(s *StageState, stateDB ethdb.Database, chainConfig
|
||||
if err = tx.CommitAndBegin(context.Background()); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = printBucketsSize(tx.(ethdb.HasTx).Tx()); err != nil {
|
||||
if err = printBucketsSize(tx); err != nil {
|
||||
return err
|
||||
}
|
||||
chainContext.SetDB(tx)
|
||||
|
@ -209,14 +209,19 @@ func (s *State) Run(db ethdb.GetterPutter, tx ethdb.GetterPutter) error {
|
||||
runtime.ReadMemStats(&m)
|
||||
log.Info("Memory", "alloc", common.StorageSize(m.Alloc), "sys", common.StorageSize(m.Sys))
|
||||
log.Info("Timings", timings...)
|
||||
if err := printBucketsSize(tx.(ethdb.HasTx).Tx()); err != nil {
|
||||
if err := printBucketsSize(tx); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//nolint
|
||||
func printBucketsSize(tx ethdb.Tx) error {
|
||||
func printBucketsSize(dbTx ethdb.Getter) error {
|
||||
hasTx, ok := dbTx.(ethdb.HasTx)
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
tx := hasTx.Tx()
|
||||
if tx == nil {
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user