mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-18 12:51:39 +00:00
calculate exact log size, excluding rlp header
This commit is contained in:
parent
53ce90d789
commit
9359a5f00f
1 changed files with 5 additions and 1 deletions
|
|
@ -541,7 +541,11 @@ func (p *Peer) validateLastBlockReceipt(receiptLists []*ReceiptList, id uint64,
|
||||||
return 0, fmt.Errorf("invalid receipt structure: %v", err)
|
return 0, fmt.Errorf("invalid receipt structure: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log += uint64(len(rest))
|
logsContent, _, err := rlp.SplitList(rest)
|
||||||
|
if err != nil {
|
||||||
|
return 0, fmt.Errorf("invalid receipt logs: %v", err)
|
||||||
|
}
|
||||||
|
log += uint64(len(logsContent))
|
||||||
}
|
}
|
||||||
// Verify that the overall downloaded receipt size does not exceed the block gas limit.
|
// Verify that the overall downloaded receipt size does not exceed the block gas limit.
|
||||||
if previousLog+log > gasUsed/params.LogDataGas {
|
if previousLog+log > gasUsed/params.LogDataGas {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue