Commit be0be0a1 authored by Sietse Ringers's avatar Sietse Ringers

fix: off by one error in revocation memory db insert

parent 5a078b64
......@@ -213,12 +213,12 @@ func (m memRevStorage) Insert(typ CredentialTypeIdentifier, update *revocation.U
return
}
theirStart, theirEnd, ourEnd := theirs[0].Index, theirs[len(theirs)-1].Index, ours[len(ours)-1].Index
offset := ourEnd - theirStart
if theirEnd <= ourEnd || offset < 0 {
if theirEnd <= ourEnd || ourEnd+1 < theirStart {
return
}
Logger.Trace("memdb: inserting")
offset := ourEnd + 1 - theirStart
r.SignedAccumulator = update.SignedAccumulator
r.Events = append(r.Events, theirs[offset:]...)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment