Skip to content

Commit

Permalink
Fix vote check (#1233)
Browse files Browse the repository at this point in the history
This was broken in #964
  • Loading branch information
rkeene committed Sep 27, 2018
1 parent a6715a6 commit cb7f3f0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rai/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1404,9 +1404,9 @@ rai::vote_code rai::vote_processor::vote_blocking (rai::transaction const & tran
auto result (rai::vote_code::invalid);
if (!vote_a->validate ())
{
result = rai::vote_code::replay;
auto max_vote (node.store.vote_max (transaction_a, vote_a));
if (!node.active.vote (vote_a) || max_vote->sequence < vote_a->sequence)
result = rai::vote_code::replay;
if (!node.active.vote (vote_a))
{
result = rai::vote_code::vote;
}
Expand All @@ -1428,7 +1428,9 @@ rai::vote_code rai::vote_processor::vote_blocking (rai::transaction const & tran
}
node.network.confirm_send (confirm, bytes, endpoint_a);
}
break;
case rai::vote_code::invalid:
assert (false);
break;
}
}
Expand Down

0 comments on commit cb7f3f0

Please sign in to comment.