Commit 06be5347 authored by Michael de Hoog's avatar Michael de Hoog

Check that BlockNumber is non-nil in the receipt validation

parent 055e4e7c
...@@ -30,6 +30,9 @@ func makeReceiptsFn(block eth.BlockID, receiptHash common.Hash) func(txHashes [] ...@@ -30,6 +30,9 @@ func makeReceiptsFn(block eth.BlockID, receiptHash common.Hash) func(txHashes []
if r.TransactionIndex != uint(i) { if r.TransactionIndex != uint(i) {
return nil, fmt.Errorf("receipt %d has unexpected tx index %d", i, r.TransactionIndex) return nil, fmt.Errorf("receipt %d has unexpected tx index %d", i, r.TransactionIndex)
} }
if r.BlockNumber == nil {
return nil, fmt.Errorf("receipt %d has unexpected nil block number, expected %d", i, block.Number)
}
if r.BlockNumber.Uint64() != block.Number { if r.BlockNumber.Uint64() != block.Number {
return nil, fmt.Errorf("receipt %d has unexpected block number %d, expected %d", i, r.BlockNumber, block.Number) return nil, fmt.Errorf("receipt %d has unexpected block number %d, expected %d", i, r.BlockNumber, block.Number)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment