Skip to content

Commit

Permalink
Merge pull request #3218 from economicstudio/fix-zero-voting-power
Browse files Browse the repository at this point in the history
fix zero voting power
  • Loading branch information
Michael Vandeberg committed Jan 7, 2019
2 parents 9e83f66 + 3ca8b41 commit fded6d7
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit fded6d7

Please sign in to comment.