diff options
Diffstat (limited to 'light')
-rw-r--r-- | light/odr_test.go | 2 | ||||
-rw-r--r-- | light/odr_util.go | 5 |
2 files changed, 2 insertions, 5 deletions
diff --git a/light/odr_test.go b/light/odr_test.go index 57b377c41..912a0cbdd 100644 --- a/light/odr_test.go +++ b/light/odr_test.go @@ -122,7 +122,7 @@ func odrGetReceipts(ctx context.Context, db ethdb.Database, bc *core.BlockChain, if bc != nil { number := rawdb.ReadHeaderNumber(db, bhash) if number != nil { - receipts = rawdb.ReadReceipts(db, bhash, *number) + receipts = rawdb.ReadReceipts(db, bhash, *number, bc.Config()) } } else { number := rawdb.ReadHeaderNumber(db, bhash) diff --git a/light/odr_util.go b/light/odr_util.go index f84de6671..cce532f8e 100644 --- a/light/odr_util.go +++ b/light/odr_util.go @@ -135,7 +135,6 @@ func GetBlockReceipts(ctx context.Context, odr OdrBackend, hash common.Hash, num } receipts = r.Receipts } - // If the receipts are incomplete, fill the derived fields if len(receipts) > 0 && receipts[0].TxHash == (common.Hash{}) { block, err := GetBlock(ctx, odr, hash, number) @@ -145,12 +144,11 @@ func GetBlockReceipts(ctx context.Context, odr OdrBackend, hash common.Hash, num genesis := rawdb.ReadCanonicalHash(odr.Database(), 0) config := rawdb.ReadChainConfig(odr.Database(), genesis) - if err := rawdb.SetReceiptsData(config, block.Hash(), block.Number(), block.Body(), receipts); err != nil { + if err := receipts.DeriveFields(config, block.Hash(), block.NumberU64(), block.Transactions()); err != nil { return nil, err } rawdb.WriteReceipts(odr.Database(), hash, number, receipts) } - return receipts, nil } @@ -162,7 +160,6 @@ func GetBlockLogs(ctx context.Context, odr OdrBackend, hash common.Hash, number if err != nil { return nil, err } - // Return the logs without deriving any computed fields on the receipts logs := make([][]*types.Log, len(receipts)) for i, receipt := range receipts { |