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 zero voting power #3220

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
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
5 changes: 4 additions & 1 deletion libraries/plugins/apis/condenser_api/condenser_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2082,14 +2082,17 @@ uint16_t api_account_object::_compute_voting_power( const database_api::api_acco
vp_t2 /= vests;

uint64_t vp_t2u = vp_t2.to_uint64();
if( vt_t2u == 0 )
return 0;

if( vp_t2u >= STEEM_100_PERCENT )
{
wlog( "Truncated vp_t2u to STEEM_100_PERCENT for account ${a}", ("a", a.name) );
vp_t2u = STEEM_100_PERCENT;
}
uint16_t vp_t1 = uint16_t( vp_t2u ) - uint16_t( std::min( vp_t2u, vp_dt ) );

return vp_t1;
return vp_t1 ? vp_t1 : a.voting_power;
}

condenser_api::condenser_api()
Expand Down