提交 15929141 编写于 作者: A Alex Shkor 提交者: GitHub

Vote power calculation fix

Vote power should be equal to last vote power plus regenerated from latest vote, but not to exceed account social power. That's why we should take *min* but not *max*
上级 feb65aa2
......@@ -93,7 +93,7 @@ void apply_social_vote() {
static Account account;
Db::get( "account", account );
auto abs_vote = abs(vote.vote_power);
account.vote_power = max( account.social_power,
account.vote_power = min( account.social_power,
account.vote_power + (account.social_power * (now()-last_vote)) / days(7));
assert( abs_vote <= account.vote_power, "insufficient vote power" );
post.votes += vote.vote_power;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册