mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
core/rawdb: fix nil deref in BenchmarkWriteAncientBlocks
This commit is contained in:
parent
d6bcad1c3e
commit
6995ebd301
1 changed files with 5 additions and 1 deletions
|
|
@ -649,11 +649,15 @@ func makeTestBlocks(nblock int, txsPerBlock int) []*types.Block {
|
|||
// makeTestReceipts creates fake receipts for the ancient write benchmark.
|
||||
func makeTestReceipts(n int, nPerBlock int) []types.Receipts {
|
||||
receipts := make([]*types.Receipt, nPerBlock)
|
||||
var logs []*types.Log
|
||||
for i := 0; i < 5; i++ {
|
||||
logs = append(logs, new(types.Log))
|
||||
}
|
||||
for i := 0; i < len(receipts); i++ {
|
||||
receipts[i] = &types.Receipt{
|
||||
Status: types.ReceiptStatusSuccessful,
|
||||
CumulativeGasUsed: 0x888888888,
|
||||
Logs: make([]*types.Log, 5),
|
||||
Logs: logs,
|
||||
}
|
||||
}
|
||||
allReceipts := make([]types.Receipts, n)
|
||||
|
|
|
|||
Loading…
Reference in a new issue