mirror of
https://github.com/matrix-construct/construct
synced 2024-09-30 04:38:52 +02:00
modules/vm: Calc reserve_bytes and obtain sequence numbers later.
This commit is contained in:
parent
d59f5c40ad
commit
73c85c14e1
1 changed files with 10 additions and 10 deletions
|
@ -646,21 +646,14 @@ ircd::m::vm::_eval_pdu(eval &eval,
|
|||
"Signature verification failed"
|
||||
};
|
||||
|
||||
const size_t reserve_bytes
|
||||
{
|
||||
opts.reserve_bytes == size_t(-1)?
|
||||
json::serialized(event):
|
||||
opts.reserve_bytes
|
||||
};
|
||||
// Fetch dependencies
|
||||
if(opts.fetch)
|
||||
fetch_hook(event, eval);
|
||||
|
||||
// Obtain sequence number here
|
||||
if(opts.write)
|
||||
eval.sequence = ++vm::current_sequence;
|
||||
|
||||
// Fetch dependencies
|
||||
if(opts.fetch)
|
||||
fetch_hook(event, eval);
|
||||
|
||||
// Evaluation by module hooks
|
||||
if(opts.eval)
|
||||
eval_hook(event, eval);
|
||||
|
@ -668,6 +661,13 @@ ircd::m::vm::_eval_pdu(eval &eval,
|
|||
if(!opts.write)
|
||||
return fault::ACCEPT;
|
||||
|
||||
const size_t reserve_bytes
|
||||
{
|
||||
opts.reserve_bytes == size_t(-1)?
|
||||
json::serialized(event):
|
||||
opts.reserve_bytes
|
||||
};
|
||||
|
||||
db::txn txn
|
||||
{
|
||||
*dbs::events, db::txn::opts
|
||||
|
|
Loading…
Reference in a new issue