mirror of
https://github.com/matrix-construct/construct
synced 2024-11-12 13:01:07 +01:00
ircd:Ⓜ️ Branch to remove hashes/signatures if defined when hashing.
This commit is contained in:
parent
615ccdc426
commit
d75e8d50b9
1 changed files with 15 additions and 1 deletions
|
@ -471,7 +471,21 @@ ircd::sha256::buf
|
|||
ircd::m::event::hash(const m::event &event)
|
||||
{
|
||||
thread_local char buf[64_KiB];
|
||||
const string_view preimage
|
||||
string_view preimage;
|
||||
|
||||
//TODO: tuple::keys::selection
|
||||
if(defined(json::get<"signatures"_>(event)) ||
|
||||
defined(json::get<"hashes"_>(event)))
|
||||
{
|
||||
m::event event_{event};
|
||||
json::get<"signatures"_>(event_) = {};
|
||||
json::get<"hashes"_>(event_) = {};
|
||||
preimage =
|
||||
{
|
||||
stringify(buf, event_)
|
||||
};
|
||||
}
|
||||
else preimage =
|
||||
{
|
||||
stringify(buf, event)
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue