Merge pull request #1115 from 1329576606/main

fix log.js iterator
This commit is contained in:
Hayden Young
2023-11-14 06:19:53 +08:00
committed by GitHub

View File

@@ -434,7 +434,7 @@ const Log = async (identity, { logId, logHeads, access, entryStorage, headsStora
if (useBuffer) {
const endIndex = buffer.keys.length
const startIndex = endIndex - amount
const startIndex = endIndex > amount ? endIndex - amount : 0
const keys = buffer.keys.slice(startIndex, endIndex)
for (const key of keys) {
const hash = buffer.get(key)