Merge branch 'cjd-fixed-it-with-hax' of github.com:xwiki-labs/cryptpad into cjd-fixed-it-with-hax
This commit is contained in:
commit
e3b78e20de
@ -1043,12 +1043,18 @@ var handleMessage = ChainPad.handleMessage = function (realtime, msgStr) {
|
||||
authDocAtTimeOfPatch = Patch.apply(toApply[i].content, authDocAtTimeOfPatch);
|
||||
}
|
||||
|
||||
if (Sha.hex_sha256(authDocAtTimeOfPatch) !== patch.parentHash) {
|
||||
var authDocHashAtTimeOfPatch = Sha.hex_sha256(authDocAtTimeOfPatch);
|
||||
if (authDocHashAtTimeOfPatch !== patch.parentHash) {
|
||||
debug(realtime, "patch [" + msg.hashOf + "] parentHash is not valid");
|
||||
if (Common.PARANOIA) { check(realtime); }
|
||||
//delete realtime.messages[msg.hashOf];
|
||||
return;
|
||||
}
|
||||
if (authDocAtTimeOfPatch === realtime.authDoc &&
|
||||
authDocHashAtTimeOfPatch !== realtime.best.inverseOf.parentHash)
|
||||
{
|
||||
throw new Error("authDoc does not match chain head");
|
||||
}
|
||||
|
||||
var simplePatch =
|
||||
Patch.simplify(patch, authDocAtTimeOfPatch, realtime.config.operationSimplify);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user