mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
check request ordering
This commit is contained in:
parent
be52c260a9
commit
a7cf628889
1 changed files with 7 additions and 0 deletions
|
|
@ -265,10 +265,17 @@ func ExecutableDataToBlockNoHash(data ExecutableData, versionedHashes []common.H
|
||||||
|
|
||||||
var requestsHash *common.Hash
|
var requestsHash *common.Hash
|
||||||
if requests != nil {
|
if requests != nil {
|
||||||
|
var last byte
|
||||||
for _, req := range requests {
|
for _, req := range requests {
|
||||||
|
// No empty requests.
|
||||||
if len(req) < 2 {
|
if len(req) < 2 {
|
||||||
return nil, fmt.Errorf("empty request: %v", req)
|
return nil, fmt.Errorf("empty request: %v", req)
|
||||||
}
|
}
|
||||||
|
// Check that requests are ordered by their type.
|
||||||
|
if req[0] < last {
|
||||||
|
return nil, fmt.Errorf("invalid request order: %v", req)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
h := types.CalcRequestsHash(requests)
|
h := types.CalcRequestsHash(requests)
|
||||||
requestsHash = &h
|
requestsHash = &h
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue