Fix ancestor bor receipts (#249)

This commit is contained in:
Ferran Borreguero 2021-12-01 16:08:13 +01:00 committed by GitHub
parent b1fb79a511
commit d3010f49bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1222,14 +1222,14 @@ func (bc *BlockChain) InsertReceiptChain(blockChain types.Blocks, receiptChain [
}
// BOR: Retrieve all the bor receipts.
borReceipts := types.Receipts{}
borReceipts := []types.Receipts{}
for _, block := range blockChain {
borReceipts = append(borReceipts, bc.GetBorReceiptByHash(block.Hash()))
borReceipts = append(borReceipts, []*types.Receipt{bc.GetBorReceiptByHash(block.Hash())})
}
// Write all chain data to ancients.
td := bc.GetTd(first.Hash(), first.NumberU64())
writeSize, err := rawdb.WriteAncientBlocks(bc.db, blockChain, receiptChain, []types.Receipts{borReceipts}, td)
writeSize, err := rawdb.WriteAncientBlocks(bc.db, blockChain, receiptChain, borReceipts, td)
size += writeSize
if err != nil {
log.Error("Error importing chain data to ancients", "err", err)