0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 08:12:37 +01:00

ircd:Ⓜ️:room::bootstrap: Perform pre-sort for full received auth_chain.

This commit is contained in:
Jason Volk 2020-12-07 12:15:50 -08:00
parent 05242aaa90
commit 97bb18d2e6

View file

@ -530,16 +530,25 @@ catch(const std::exception &e)
}
void
ircd::m::roomstrap::eval_auth_chain(const json::array &auth_chain,
ircd::m::roomstrap::eval_auth_chain(const json::array &auth_chain_,
vm::opts vmopts)
try
{
std::vector<m::event> auth_chain
(
begin(auth_chain_), end(auth_chain_)
);
log::info
{
log, "Evaluating %zu authentication events...",
auth_chain.size(),
};
// pre-sort here and indicate that to eval.
std::sort(begin(auth_chain), end(auth_chain));
vmopts.ordered = true;
vmopts.nothrows = vm::fault::EXISTS;
vmopts.fetch = false;
m::vm::eval