electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 641968fcf8fbb2ec8141a67aa992ce0274e08e5f
parent 94708f63e4f237f5f4c143137de797f9c0ccc08e
Author: ThomasV <thomasv@electrum.org>
Date:   Mon, 30 Nov 2020 14:47:38 +0100

Wizard: do not ask seed type, default to segwit

segwit addresses are widely supported today.

Diffstat:
Melectrum/base_wizard.py | 21+++------------------
Melectrum/commands.py | 1+
Melectrum/plugins/trustedcoin/trustedcoin.py | 10++--------
3 files changed, 6 insertions(+), 26 deletions(-)

diff --git a/electrum/base_wizard.py b/electrum/base_wizard.py @@ -685,24 +685,9 @@ class BaseWizard(Logger): def show_xpub_and_add_cosigners(self, xpub): self.show_xpub_dialog(xpub=xpub, run_next=lambda x: self.run('choose_keystore')) - def choose_seed_type(self, message=None, choices=None): - title = _('Choose Seed type') - if message is None: - message = ' '.join([ - _("The type of addresses used by your wallet will depend on your seed."), - _("Segwit wallets use bech32 addresses, defined in BIP173."), - _("Please note that websites and other wallets may not support these addresses yet."), - _("Thus, you might want to keep using a non-segwit wallet in order to be able to receive bitcoins during the transition period.") - ]) - if choices is None: - choices = [ - ('create_segwit_seed', _('Segwit')), - ('create_standard_seed', _('Legacy')), - ] - self.choice_dialog(title=title, message=message, choices=choices, run_next=self.run) - - def create_segwit_seed(self): self.create_seed('segwit') - def create_standard_seed(self): self.create_seed('standard') + def choose_seed_type(self): + seed_type = 'standard' if self.config.get('nosegwit') else 'segwit' + self.create_seed(seed_type) def create_seed(self, seed_type): from . import mnemonic diff --git a/electrum/commands.py b/electrum/commands.py @@ -1356,6 +1356,7 @@ def get_parser(): parser_gui.add_argument("-m", action="store_true", dest="hide_gui", default=False, help="hide GUI on startup") parser_gui.add_argument("-L", "--lang", dest="language", default=None, help="default language used in GUI") parser_gui.add_argument("--daemon", action="store_true", dest="daemon", default=False, help="keep daemon running after GUI is closed") + parser_gui.add_argument("--nosegwit", action="store_true", dest="nosegwit", default=False, help="Do not create segwit wallets") add_wallet_option(parser_gui) add_network_options(parser_gui) add_global_options(parser_gui) diff --git a/electrum/plugins/trustedcoin/trustedcoin.py b/electrum/plugins/trustedcoin/trustedcoin.py @@ -545,14 +545,8 @@ class TrustedCoinPlugin(BasePlugin): wizard.choice_dialog(title=title, message=message, choices=choices, run_next=wizard.run) def choose_seed_type(self, wizard): - choices = [ - ('create_2fa_segwit_seed', _('Segwit 2FA')), - ('create_2fa_seed', _('Legacy 2FA')), - ] - wizard.choose_seed_type(choices=choices) - - def create_2fa_seed(self, wizard): self.create_seed(wizard, '2fa') - def create_2fa_segwit_seed(self, wizard): self.create_seed(wizard, '2fa_segwit') + seed_type = '2fa' if self.config.get('nosegwit') else '2fa_segwit' + self.create_seed(wizard, seed_type) def create_seed(self, wizard, seed_type): seed = self.make_seed(seed_type)