URI: 
       tfix: swap - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit 6ee0ad8499181f0ddc3fcd0262ada3bcfdc19107
   DIR parent 814792eee1a26ecc6b3438ccc8255d8f26e7ee3c
  HTML Author: ThomasV <thomasv@electrum.org>
       Date:   Wed, 19 Jul 2017 05:45:41 +0200
       
       fix: swap
       
       Diffstat:
         M lib/blockchain.py                   |      12 ++----------
       
       1 file changed, 2 insertions(+), 10 deletions(-)
       ---
   DIR diff --git a/lib/blockchain.py b/lib/blockchain.py
       t@@ -197,14 +197,14 @@ class Blockchain(util.PrintError):
                self.print_error("saved", self.filename)
        
            def swap_with_parent(self):
       -        self.print_error("swap")
       +        self.print_error("swap", self.filename, self.parent.filename)
                parent = self.parent
                checkpoint = self.checkpoint
                # copy headers
                parent.headers = [parent.read_header(h) for h in range(checkpoint, checkpoint + parent.get_branch_size())]
                # truncate parent file
                with open(parent.path(), 'rb+') as f:
       -            f.seek(checkpoint*80)
       +            f.seek((checkpoint - parent.checkpoint)*80)
                    f.truncate()
                parent.is_saved = False
                # swap chains
       t@@ -272,14 +272,6 @@ class Blockchain(util.PrintError):
                h = self.local_height
                return sum([self.BIP9(h-i, 2) for i in range(N)])*10000/N/100.
        
       -    def truncate_headers(self, height):
       -        self.print_error('Truncating headers file at height %d'%height)
       -        name = self.path()
       -        f = open(name, 'rb+')
       -        f.seek(height * 80)
       -        f.truncate()
       -        f.close()
       -
            def get_target(self, index, chain=None):
                if bitcoin.TESTNET:
                    return 0, 0