fix copy: flush discards the transaction

This commit is contained in:
vyzo 2021-07-11 19:25:48 +03:00
parent 4b0b37a4ef
commit 608a9f84d2

View File

@ -409,6 +409,8 @@ func (b *Blockstore) doCopy(from, to *badger.DB, filter func(cid.Cid) bool) erro
if err := batch.Flush(); err != nil {
return err
}
// Flush discards the transaction, so we need a new batch
batch = to.NewWriteBatch()
count = 0
putPooled()
}