Fix vote check (#1233)

This was broken in #964
This commit is contained in:
Roy Keene 2018-09-27 01:31:28 -05:00 committed by GitHub
commit cb7f3f0cbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
@ -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;
}
}