handle the large first receipt case

This commit is contained in:
healthykim 2026-03-30 18:29:58 +09:00
parent 9ab6b2fe11
commit 3bebd989ba
2 changed files with 7 additions and 0 deletions

View file

@ -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 {

View file

@ -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
}