From 13be937c9fb669e43ffb5258cfd1ed0a77931091 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 3 Dec 2018 20:41:59 +0100 Subject: [PATCH] - Added static fee - Added LBRY Explorer integration - Legacy is now auto selected - Small code fixes --- electrum/base_wizard.py | 6 ++--- electrum/gui/qt/main_window.py | 12 +++++----- electrum/simple_config.py | 7 +++--- electrum/util.py | 40 +++------------------------------- 4 files changed, 15 insertions(+), 50 deletions(-) diff --git a/electrum/base_wizard.py b/electrum/base_wizard.py index 8df1d624c..8edef001c 100644 --- a/electrum/base_wizard.py +++ b/electrum/base_wizard.py @@ -340,14 +340,14 @@ class BaseWizard(object): # There is no general standard for HD multisig. # For legacy, this is partially compatible with BIP45; assumes index=0 # For segwit, a custom path is used, as there is no standard at all. - default_choice_idx = 2 + default_choice_idx = 0 choices = [ ('standard', 'legacy multisig (p2sh)', "m/45'/0"), ('p2wsh-p2sh', 'p2sh-segwit multisig (p2wsh-p2sh)', purpose48_derivation(0, xtype='p2wsh-p2sh')), ('p2wsh', 'native segwit multisig (p2wsh)', purpose48_derivation(0, xtype='p2wsh')), ] else: - default_choice_idx = 2 + default_choice_idx = 0 choices = [ ('standard', 'legacy (p2pkh)', bip44_derivation(0, bip43_purpose=44)), ('p2wpkh-p2sh', 'p2sh-segwit (p2wpkh-p2sh)', bip44_derivation(0, bip43_purpose=49)), @@ -547,7 +547,7 @@ class BaseWizard(object): _("Thus, you might want to keep using a non-segwit wallet in order to be able to receive LBRY Credits during the transition period.") ]) choices = [ - + ('create_standard_seed', _('Legacy')), ] self.choice_dialog(title=title, message=message, choices=choices, run_next=self.run) diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index 11dad7b61..faeb35d16 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -834,7 +834,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): self.receive_address_e = ButtonsLineEdit() self.receive_address_e.addCopyButton(self.app) self.receive_address_e.setReadOnly(True) - msg = _('Bitcoin address where the payment should be received. Note that each payment request uses a different Bitcoin address.') + msg = _('LBRY Credits address where the payment should be received. Note that each payment request uses a different LBRY Credits address.') self.receive_address_label = HelpLabel(_('Receiving address'), msg) self.receive_address_e.textChanged.connect(self.update_receive_qr) self.receive_address_e.setFocusPolicy(Qt.ClickFocus) @@ -864,8 +864,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): msg = ' '.join([ _('Expiration date of your request.'), _('This information is seen by the recipient if you send them a signed payment request.'), - _('Expired requests have to be deleted manually from your list, in order to free the corresponding Bitcoin addresses.'), - _('The bitcoin address never expires and will always be part of this electrum wallet.'), + _('Expired requests have to be deleted manually from your list, in order to free the corresponding LBRY Credits addresses.'), + _('The LBRY Credits address never expires and will always be part of this electrum wallet.'), ]) grid.addWidget(HelpLabel(_('Request expires'), msg), 3, 0) grid.addWidget(self.expires_combo, 3, 1) @@ -1091,7 +1091,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): self.amount_e = BTCAmountEdit(self.get_decimal_point) self.payto_e = PayToEdit(self) msg = _('Recipient of the funds.') + '\n\n'\ - + _('You may enter a Bitcoin address, a label from your list of contacts (a list of completions will be proposed), or an alias (email-like address that forwards to a Bitcoin address)') + + _('You may enter a LBRY Credits address, a label from your list of contacts (a list of completions will be proposed), or an alias (email-like address that forwards to a Bitcoin address)') payto_label = HelpLabel(_('Pay to'), msg) grid.addWidget(payto_label, 1, 0) grid.addWidget(self.payto_e, 1, 1, 1, -1) @@ -1138,7 +1138,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): hbox.addStretch(1) grid.addLayout(hbox, 4, 4) - msg = _('Bitcoin transactions are in general not free. A transaction fee is paid by the sender of the funds.') + '\n\n'\ + msg = _('LBRY Credits transactions are in general not free. A transaction fee is paid by the sender of the funds.') + '\n\n'\ + _('The amount of fee can be decided freely by the sender. However, transactions with low fees take more time to be processed.') + '\n\n'\ + _('A suggested fee is automatically added to this field. You may override it. The suggested fee increases with the size of the transaction.') self.fee_e_label = HelpLabel(_('Fee'), msg) @@ -2739,7 +2739,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): fee_widgets.append((fee_type_label, fee_type_combo)) feebox_cb = QCheckBox(_('Edit fees manually')) - feebox_cb.setChecked(self.config.get('show_fee', False)) + feebox_cb.setChecked(self.config.get('show_fee', True)) feebox_cb.setToolTip(_("Show fee edit box in send tab.")) def on_feebox(x): self.config.set_key('show_fee', x == Qt.Checked) diff --git a/electrum/simple_config.py b/electrum/simple_config.py index 46f753941..e864e2850 100644 --- a/electrum/simple_config.py +++ b/electrum/simple_config.py @@ -20,10 +20,9 @@ FEE_DEPTH_TARGETS = [10000000, 5000000, 2000000, 1000000, 500000, 200000, 100000 # satoshi per kbyte FEERATE_MAX_DYNAMIC = 1500000 FEERATE_WARNING_HIGH_FEE = 600000 -FEERATE_FALLBACK_STATIC_FEE = 150000 -FEERATE_DEFAULT_RELAY = 1000 -FEERATE_STATIC_VALUES = [1000, 2000, 5000, 10000, 20000, 30000, - 50000, 70000, 100000, 150000, 200000, 300000] +FEERATE_FALLBACK_STATIC_FEE = 50000 +FEERATE_DEFAULT_RELAY = 50000 +FEERATE_STATIC_VALUES = [50000, 50000,] config = None diff --git a/electrum/util.py b/electrum/util.py index 0287f7a68..3fee61fb2 100644 --- a/electrum/util.py +++ b/electrum/util.py @@ -620,44 +620,10 @@ def time_difference(distance_in_time, include_seconds): return "over %d years" % (round(distance_in_minutes / 525600)) mainnet_block_explorers = { - 'Bitupper Explorer': ('https://bitupper.com/en/explorer/bitcoin/', - {'tx': 'transactions/', 'addr': 'addresses/'}), - 'Biteasy.com': ('https://www.biteasy.com/blockchain/', - {'tx': 'transactions/', 'addr': 'addresses/'}), - 'Bitflyer.jp': ('https://chainflyer.bitflyer.jp/', - {'tx': 'Transaction/', 'addr': 'Address/'}), - 'Blockchain.info': ('https://blockchain.info/', + 'LBRY Explorer': ('https://explorer.lbry.io/', {'tx': 'tx/', 'addr': 'address/'}), - 'blockchainbdgpzk.onion': ('https://blockchainbdgpzk.onion/', - {'tx': 'tx/', 'addr': 'address/'}), - 'Blockr.io': ('https://btc.blockr.io/', - {'tx': 'tx/info/', 'addr': 'address/info/'}), - 'Blockstream.info': ('https://blockstream.info/', - {'tx': 'tx/', 'addr': 'address/'}), - 'Blocktrail.com': ('https://www.blocktrail.com/BTC/', - {'tx': 'tx/', 'addr': 'address/'}), - 'BTC.com': ('https://chain.btc.com/', - {'tx': 'tx/', 'addr': 'address/'}), - 'Chain.so': ('https://www.chain.so/', - {'tx': 'tx/BTC/', 'addr': 'address/BTC/'}), - 'Insight.is': ('https://insight.bitpay.com/', - {'tx': 'tx/', 'addr': 'address/'}), - 'TradeBlock.com': ('https://tradeblock.com/blockchain/', - {'tx': 'tx/', 'addr': 'address/'}), - 'BlockCypher.com': ('https://live.blockcypher.com/btc/', - {'tx': 'tx/', 'addr': 'address/'}), - 'Blockchair.com': ('https://blockchair.com/bitcoin/', - {'tx': 'transaction/', 'addr': 'address/'}), - 'blockonomics.co': ('https://www.blockonomics.co/', - {'tx': 'api/tx?txid=', 'addr': '#/search?q='}), - 'OXT.me': ('https://oxt.me/', - {'tx': 'transaction/', 'addr': 'address/'}), - 'smartbit.com.au': ('https://www.smartbit.com.au/', - {'tx': 'tx/', 'addr': 'address/'}), - 'system default': ('blockchain:/', - {'tx': 'tx/', 'addr': 'address/'}), -} - + } + testnet_block_explorers = { 'Blocktrail.com': ('https://www.blocktrail.com/tBTC/', {'tx': 'tx/', 'addr': 'address/'}),