0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-02-16 16:50:12 +01:00

ircd:Ⓜ️:vm::fetch: Perform pre-sort for full received auth_chain.

This commit is contained in:
Jason Volk 2020-12-07 14:14:58 -08:00
parent 97bb18d2e6
commit 2b6bb16bf4

View file

@ -338,7 +338,7 @@ void
ircd::m::vm::fetch::auth_chain_eval(const event &event,
vm::eval &eval,
const room &room,
const json::array &auth_chain,
const json::array &auth_chain_,
const string_view &origin)
try
{
@ -349,6 +349,16 @@ try
opts.warnlog &= ~vm::fault::EXISTS;
opts.notify_servers = false;
opts.node_id = origin;
std::vector<m::event> auth_chain
(
std::begin(auth_chain_), std::end(auth_chain_)
);
// pre-sort here and indicate that to eval.
std::sort(begin(auth_chain), end(auth_chain));
opts.ordered = true;
log::debug
{
log, "Evaluating auth chain for %s in %s events:%zu",