fix getPayloadBodiesByRange upper limit

This commit is contained in:
jangko 2023-08-17 14:02:04 +07:00
parent c6e7ac1647
commit 3f0506b5bc
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
1 changed files with 6 additions and 1 deletions

View File

@ -537,7 +537,12 @@ proc handle_getPayloadBodiesByRange(com: CommonRef,
let db = com.db
var header: BlockHeader
for bn in start..<start+count:
var last = start+count-1
let current = com.syncCurrent.truncate(uint64)
if last > current:
last = current
for bn in start..last:
if not db.getBlockHeader(bn.toBlockNumber, header):
result.add none(ExecutionPayloadBodyV1)
continue