mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
internal/era: error if accumulator has more records than max allowed
This commit is contained in:
parent
ca3d8bf717
commit
cccf47b4f4
1 changed files with 3 additions and 0 deletions
|
|
@ -30,6 +30,9 @@ func ComputeAccumulator(hashes []common.Hash, tds []*big.Int) (common.Hash, erro
|
|||
if len(hashes) != len(tds) {
|
||||
return common.Hash{}, fmt.Errorf("must have equal number hashes as td values")
|
||||
}
|
||||
if len(hashes) > MaxEra1Size {
|
||||
return common.Hash{}, fmt.Errorf("too many records: have %d, max %d", len(hashes), MaxEra1Size)
|
||||
}
|
||||
hh := ssz.NewHasher()
|
||||
for i := range hashes {
|
||||
rec := headerRecord{hashes[i], tds[i]}
|
||||
|
|
|
|||
Loading…
Reference in a new issue