mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 18:01:36 +00:00
handle the large first receipt case
This commit is contained in:
parent
9ab6b2fe11
commit
3bebd989ba
2 changed files with 7 additions and 0 deletions
|
|
@ -328,6 +328,9 @@ func serviceGetReceiptsQuery70(chain *core.BlockChain, query GetReceiptsRequest,
|
|||
log.Error("Error in block receipts conversion", "hash", hash, "err", err)
|
||||
continue
|
||||
}
|
||||
if results == nil {
|
||||
break
|
||||
}
|
||||
receipts.AppendRaw(results)
|
||||
bytes += len(results)
|
||||
if incomplete {
|
||||
|
|
|
|||
|
|
@ -276,6 +276,10 @@ func blockReceiptsToNetwork(blockReceipts, blockBody rlp.RawValue, q receiptQuer
|
|||
// which is always true because EIP-2718 does not allow tx types > 0x7f.
|
||||
size := rlp.ListSize(1 + uint64(len(content)))
|
||||
if q.sizeLimit > 0 && (uint64(enc.Size())+size) > q.sizeLimit {
|
||||
if uint(i) == uint(q.firstIndex) {
|
||||
// The first receipt doesn't fit into the size limit.
|
||||
return nil, false, nil
|
||||
}
|
||||
incomplete = true
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue