Commit 728c06f1 authored by Samuel Alphée Richard's avatar Samuel Alphée Richard
Browse files

Fixed mana regeneration maths

parent 040265ca
Pipeline #389669432 canceled with stages
......@@ -387,15 +387,21 @@ class Voting extends React.Component {
const net_vesting_shares =
vesting_shares -
delegated_vesting_shares +
received_vesting_shares -
Number(vesting_withdraw_rate);
received_vesting_shares;
const maxMana = net_vesting_shares * 1000000;
if (current_mana > maxMana) {
current_mana = maxMana;
const maxMana = (net_vesting_shares - Number(vesting_withdraw_rate)) * 1000000;
const now = Math.round(Date.now() / 1000);
const elapsed = now - last_update_time;
const regenerated_mana = (elapsed * maxMana) / BLURT_VOTING_MANA_REGENERATION_SECONDS
let currentMana = current_mana;
currentMana += regenerated_mana;
if (currentMana >= maxMana) {
currentMana = maxMana;
}
const currentVp = (current_mana * 100) / maxMana;
const currentVp = (currentMana * 100) / maxMana;
const operation = {
voter: username,
......@@ -528,7 +534,7 @@ class Voting extends React.Component {
{voteValue.toFixed(3)} BLURT
<br />
{tt('voting_jsx.voting_power')}:{' '}
{currentVp.toFixed(1)}%
{currentVp.toFixed(2)}%
<br />
{tt('g.transaction_fee')}: {fee} BLURT
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment