1
0

Create a constant for 100000000 and use it

Use same name as is in bitcoind.
Note that one of the constants in text.py had the wrong number
of zeroes previously...
This commit is contained in:
Neil Booth
2015-06-01 11:26:22 +09:00
parent 4d9be9a6d2
commit 03e53a5e01
10 changed files with 51 additions and 50 deletions

View File

@@ -1,10 +1,9 @@
import curses, datetime, locale
from decimal import Decimal
_ = lambda x:x
#from i18n import _
from electrum.util import format_satoshis, set_verbosity
from electrum.util import StoreDict
from electrum.bitcoin import is_valid
from electrum.bitcoin import is_valid, COIN
from electrum import Wallet, WalletStorage
@@ -133,11 +132,11 @@ class ElectrumGui:
msg = _("Synchronizing...")
else:
c, u, x = self.wallet.get_balance()
msg = _("Balance")+": %f "%(Decimal(c) / 100000000)
msg = _("Balance")+": %f "%(Decimal(c) / COIN)
if u:
msg += " [%f unconfirmed]"%(Decimal(u) / 100000000)
msg += " [%f unconfirmed]"%(Decimal(u) / COIN)
if x:
msg += " [%f unmatured]"%(Decimal(x) / 100000000)
msg += " [%f unmatured]"%(Decimal(x) / COIN)
else:
msg = _("Not connected")
@@ -297,12 +296,12 @@ class ElectrumGui:
self.show_message(_('Invalid Bitcoin address'))
return
try:
amount = int( Decimal( self.str_amount) * 100000000 )
amount = int(Decimal(self.str_amount) * COIN)
except Exception:
self.show_message(_('Invalid Amount'))
return
try:
fee = int( Decimal( self.str_fee) * 100000000 )
fee = int(Decimal(self.str_fee) * COIN)
except Exception:
self.show_message(_('Invalid Fee'))
return
@@ -388,7 +387,7 @@ class ElectrumGui:
if out.get('Default GUI'):
self.config.set_key('gui', out['Default GUI'], True)
if out.get('Default fee'):
fee = int ( Decimal( out['Default fee']) *10000000 )
fee = int(Decimal(out['Default fee']) * COIN)
self.config.set_key('fee_per_kb', fee, True)