@@ -235,6 +235,8 @@ def get_rc_manabar(self):
235235 last_update = datetime .utcfromtimestamp (last_update_time )
236236 diff_in_seconds = (addTzInfo (datetime .utcnow ()) - addTzInfo (last_update )).total_seconds ()
237237 estimated_mana = int (current_mana + diff_in_seconds * estimated_max / STEEM_VOTING_MANA_REGENERATION_SECONDS )
238+ if estimated_mana > estimated_max :
239+ estimated_mana = estimated_max
238240 estimated_pct = estimated_mana / estimated_max * 100
239241 return {"current_mana" : current_mana , "last_update_time" : last_update_time ,
240242 "estimated_mana" : estimated_mana , "estimated_max" : estimated_max , "estimated_pct" : estimated_pct }
@@ -328,7 +330,7 @@ def print_info(self, force_refresh=False, return_str=False, use_table=False, **k
328330 t .add_row (["Remaining Bandwidth" , "%.2f %%" % (remaining )])
329331 t .add_row (["used/allocated Bandwidth" , "(%.0f kb of %.0f mb)" % (used_kb , allocated_mb )])
330332 if rc_mana is not None :
331- t .add_row (["Remaining RC" , "%.2f %%" % (rc_mana ["current_mana" ] / rc_mana [ "max_mana" ] * 100 )])
333+ t .add_row (["Remaining RC" , "%.2f %%" % (rc_mana ["estimated_pct" ] )])
332334 t .add_row (["used/allocated RC" , "(%.0f of %.0f)" % (int (rc ["max_rc" ]) * rc_mana ["estimated_pct" ], int (rc ["max_rc" ]))])
333335 t .add_row (["Full in " , "%s" % (self .get_manabar_recharge_time_str (rc_mana ))])
334336 if return_str :
@@ -350,7 +352,7 @@ def print_info(self, force_refresh=False, return_str=False, use_table=False, **k
350352 ret += " (%.0f kb of %.0f mb)\n " % (used_kb , allocated_mb )
351353 if rc_mana is not None :
352354 ret += "--- RC manabar ---\n "
353- ret += "Remaining: %.2f %%" % (rc_mana ["current_mana" ] / rc_mana [ "estimated_max" ] * 100 )
355+ ret += "Remaining: %.2f %%" % (rc_mana ["estimated_pct" ] )
354356 ret += " (%.0f of %.0f)\n " % (int (rc ["max_rc" ]) * rc_mana ["estimated_pct" ], int (rc ["max_rc" ]))
355357 ret += "full in %s \n " % (self .get_manabar_recharge_time_str (rc_mana ))
356358 if return_str :
@@ -379,6 +381,8 @@ def get_manabar(self):
379381 last_update = datetime .utcfromtimestamp (last_update_time )
380382 diff_in_seconds = (addTzInfo (datetime .utcnow ()) - addTzInfo (last_update )).total_seconds ()
381383 estimated_mana = int (current_mana + diff_in_seconds * estimated_max / STEEM_VOTING_MANA_REGENERATION_SECONDS )
384+ if estimated_mana > estimated_max :
385+ estimated_mana = estimated_max
382386 estimated_pct = estimated_mana / estimated_max * 100
383387 return {"current_mana" : current_mana , "last_update_time" : last_update_time ,
384388 "estimated_mana" : estimated_mana , "estimated_max" : estimated_max , "estimated_pct" : estimated_pct }
0 commit comments