mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-03-30 15:08:28 +00:00
fix log.js iterator
fix log.js iterator
This commit is contained in:
parent
9b8bcb7257
commit
d24dffc0a8
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user