erigon22: workers correct rollback #5387

This commit is contained in:
Alex Sharov 2022-09-16 11:17:56 +07:00 committed by GitHub
parent 390108f352
commit 10039f0431
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,12 +77,10 @@ func NewWorker22(lock sync.Locker, background bool, chainDb kv.RoDB, wg *sync.Wa
func (rw *Worker22) Tx() kv.Tx { return rw.chainTx }
func (rw *Worker22) ResetTx(chainTx kv.Tx) {
if rw.background && chainTx != nil {
if rw.chainTx != nil {
if rw.background && rw.chainTx != nil {
rw.chainTx.Rollback()
rw.chainTx = nil
}
}
if chainTx != nil {
rw.chainTx = chainTx
rw.stateReader.SetTx(rw.chainTx)