0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd:Ⓜ️:dbs: Add comment; branch expect.

This commit is contained in:
Jason Volk 2019-05-09 22:24:48 -07:00
parent a331bc2882
commit 99e10d38dc

View file

@ -572,10 +572,14 @@ ircd::m::dbs::_index_event_refs_state(db::txn &txn,
0UL
};
// No previous state; nothing to do.
if(!prev_state_idx)
return;
if(prev_state_idx >= opts.event_idx)
// If the previous state's event_idx is greater than the event_idx of the
// event we're transacting this is almost surely a replay/rewrite. Bail
// out for now rather than corrupting the graph.
if(unlikely(prev_state_idx >= opts.event_idx))
return;
thread_local char buf[EVENT_REFS_KEY_MAX_SIZE];