Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix governance vote purge #221

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion hook/genesis/govern.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,14 @@ int64_t hook(uint32_t r)
previous_member[3] = tbl;

uint8_t vote_key[32];
dangell7 marked this conversation as resolved.
Show resolved Hide resolved
if (state(SBUF(vote_key), SBUF(previous_member)) > 0)
uint8_t ts =
previous_member[1] == 'H' ? 32 : // hook topics are a 32 byte hook hash
previous_member[1] == 'S' ? 20 : // account topics are a 20 byte account ID
8; // reward topics are an 8 byte le xfl

uint8_t padding = 32 - ts;

if (state(vote_key + padding, 32, SBUF(previous_member)) == 32)
dangell7 marked this conversation as resolved.
Show resolved Hide resolved
{
uint8_t vote_count = 0;

Expand Down
Loading