This commit is contained in:
alex.sharov 2023-04-19 12:12:51 +07:00
parent 72502e18f0
commit 3b66aa0571
2 changed files with 3 additions and 2 deletions

View File

@ -303,8 +303,6 @@ func NewWorkersPool(lock sync.Locker, ctx context.Context, background bool, chai
w.ResetTx(nil) w.ResetTx(nil)
} }
//applyWorker.ResetTx(nil) //applyWorker.ResetTx(nil)
log.Warn("before rws.Close()")
rws.Close()
} }
} }
applyWorker = NewWorker(lock, ctx, false, chainDb, rs, in, blockReader, chainConfig, genesis, rws, engine) applyWorker = NewWorker(lock, ctx, false, chainDb, rs, in, blockReader, chainConfig, genesis, rws, engine)

View File

@ -271,6 +271,8 @@ func ExecV3(ctx context.Context,
if parallel { if parallel {
// `rwLoop` lives longer than `applyLoop` // `rwLoop` lives longer than `applyLoop`
rwLoop := func(ctx context.Context) error { rwLoop := func(ctx context.Context) error {
defer stopWorkers()
tx, err := chainDb.BeginRw(ctx) tx, err := chainDb.BeginRw(ctx)
if err != nil { if err != nil {
return err return err
@ -419,6 +421,7 @@ func ExecV3(ctx context.Context,
if err = tx.Commit(); err != nil { if err = tx.Commit(); err != nil {
return err return err
} }
rws.Close()
return nil return nil
} }