Recreate bitmap in call traces (#2700)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
This commit is contained in:
ledgerwatch 2021-09-18 22:41:27 +01:00 committed by GitHub
parent 8d9e058eb7
commit 836d7e07f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,13 +179,13 @@ func promoteCallTraces(logPrefix string, tx kv.RwTx, startBlock, endBlock uint64
}
func finaliseCallTraces(collectorFrom, collectorTo *etl.Collector, logPrefix string, tx kv.RwTx, quit <-chan struct{}) error {
var currentBitmap = roaring64.New()
var buf = bytes.NewBuffer(nil)
lastChunkKey := make([]byte, 128)
reader := bytes.NewReader(nil)
reader2 := bytes.NewReader(nil)
var loaderFunc = func(k []byte, v []byte, table etl.CurrentTableReader, next etl.LoadNextFunc) error {
reader.Reset(v)
currentBitmap := roaring64.New()
if _, err := currentBitmap.ReadFrom(reader); err != nil {
return err
}
@ -215,7 +215,6 @@ func finaliseCallTraces(collectorFrom, collectorTo *etl.Collector, logPrefix str
}); err != nil {
return err
}
currentBitmap.Clear()
return nil
}
if err := collectorFrom.Load(logPrefix, tx, kv.CallFromIndex, loaderFunc, etl.TransformArgs{Quit: quit}); err != nil {