URI: 
       tforce pubkey regeneration in some multisig wallets - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 96016a9ee8d6e5198659e682d823fbe44e140f98
   DIR parent 7904481a1c9bb3cfc1d35bd3baf9083e6a5cc3d7
  HTML Author: ThomasV <thomasv@electrum.org>
       Date:   Sun, 16 Oct 2016 21:59:28 +0200
       
       force pubkey regeneration in some multisig wallets
       
       Diffstat:
         M lib/storage.py                      |      24 ++++++++++++++++++++++--
         M lib/version.py                      |       6 ------
       
       2 files changed, 22 insertions(+), 8 deletions(-)
       ---
   DIR diff --git a/lib/storage.py b/lib/storage.py
       t@@ -37,7 +37,15 @@ from i18n import _
        from util import NotEnoughFunds, PrintError, profiler
        from plugins import run_hook, plugin_loaders
        from keystore import bip44_derivation
       -from version import *
       +
       +
       +# seed_version is now used for the version of the wallet file
       +
       +OLD_SEED_VERSION = 4        # electrum versions < 2.0
       +NEW_SEED_VERSION = 11       # electrum versions >= 2.0
       +FINAL_SEED_VERSION = 13     # electrum >= 2.7 will set this to prevent
       +                            # old versions from overwriting new format
       +
        
        
        def multisig_type(wallet_type):
       t@@ -213,8 +221,18 @@ class WalletStorage(PrintError):
                self.convert_imported()
                self.convert_wallet_type()
                self.convert_account()
       +        self.convert_pubkeys()
                self.write()
        
       +    def convert_pubkeys(self):
       +        # version 12 had a bug in pubkey ordering
       +        # it is fixed by forcing pubkey regeneration
       +        if self.get_seed_version() != 12:
       +            return
       +        if self.get('wallet_type') in ['standard', 'imported']:
       +            return
       +        self.put('pubkeys', {})
       +
            def convert_wallet_type(self):
                wallet_type = self.get('wallet_type')
                if wallet_type == 'btchip': wallet_type = 'ledger'
       t@@ -334,7 +352,9 @@ class WalletStorage(PrintError):
                seed_version = self.get('seed_version')
                if not seed_version:
                    seed_version = OLD_SEED_VERSION if len(self.get('master_public_key','')) == 128 else NEW_SEED_VERSION
       -        if seed_version not in [OLD_SEED_VERSION, NEW_SEED_VERSION, FINAL_SEED_VERSION]:
       +        if seed_version >=12:
       +            return seed_version
       +        if seed_version not in [OLD_SEED_VERSION, NEW_SEED_VERSION]:
                    msg = "Your wallet has an unsupported seed version."
                    msg += '\n\nWallet file: %s' % os.path.abspath(self.path)
                    if seed_version in [5, 7, 8, 9, 10]:
   DIR diff --git a/lib/version.py b/lib/version.py
       t@@ -1,12 +1,6 @@
        ELECTRUM_VERSION = '2.7.8'  # version of the client package
        PROTOCOL_VERSION = '0.10'   # protocol version requested
        
       -OLD_SEED_VERSION = 4        # electrum versions < 2.0
       -NEW_SEED_VERSION = 11       # electrum versions >= 2.0
       -FINAL_SEED_VERSION = 12     # electrum >= 2.7 will set this to prevent
       -                            # old versions from overwriting new format
       -
       -
        # The hash of the mnemonic seed must begin with this
        SEED_PREFIX      = '01'      # Electrum standard wallet
        SEED_PREFIX_2FA  = '101'     # extended seed for two-factor authentication