electrum

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

commit 075dfb5ccbbe7f313aed2d38bfec2f6acdd17748
parent 4cfa513ff1e6b0755e46e01e7588a25d1e7a7019
Author: ThomasV <thomasv@electrum.org>
Date:   Fri, 19 May 2017 08:55:40 +0200

separate truncate_headers for debugging

Diffstat:
Mlib/blockchain.py | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/blockchain.py b/lib/blockchain.py @@ -202,10 +202,13 @@ class Blockchain(util.PrintError): if self.hash_header(checkpoint) == self.checkpoint_hash: return self.print_error('checkpoint mismatch:', self.hash_header(checkpoint), self.checkpoint_hash) - self.print_error('Truncating headers file at height %d'%self.checkpoint_height) + self.truncate_headers(self.checkpoint_height) + + def truncate_headers(self, height): + self.print_error('Truncating headers file at height %d'%height) name = self.path() f = open(name, 'rb+') - f.seek(self.checkpoint_height * 80) + f.seek(height * 80) f.truncate() f.close()