X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=backends%2Fbitcoind%2Fblockchain_processor.py;h=538478dc73b1b454112927a6570bba48f48b0abd;hb=4a82994032a48db0fc4be814091215c69891ab17;hp=174d18611ff564629dc3690e9dbb8a22c4bb8505;hpb=565e2858aff58e882c62719fced34a1679161011;p=electrum-server.git diff --git a/backends/bitcoind/blockchain_processor.py b/backends/bitcoind/blockchain_processor.py index 174d186..538478d 100644 --- a/backends/bitcoind/blockchain_processor.py +++ b/backends/bitcoind/blockchain_processor.py @@ -42,7 +42,7 @@ class BlockchainProcessor(Processor): self.dblock = threading.Lock() try: - self.db = leveldb.LevelDB(self.dbpath) + self.db = leveldb.LevelDB(self.dbpath, paranoid_checks=True) except: traceback.print_exc(file=sys.stdout) self.shared.stop() @@ -256,8 +256,11 @@ class BlockchainProcessor(Processor): vds = deserialize.BCDataStream() vds.write(raw_tx.decode('hex')) - - return deserialize.parse_Transaction(vds, is_coinbase=False) + try: + return deserialize.parse_Transaction(vds, is_coinbase=False) + except: + print_log("ERROR: cannot parse", txid) + return None def get_history(self, addr, cache_only=False): with self.cache_lock: @@ -457,10 +460,14 @@ class BlockchainProcessor(Processor): is_coinbase = True for raw_tx in txlist: tx_hash = hash_encode(Hash(raw_tx.decode('hex'))) - tx_hashes.append(tx_hash) vds = deserialize.BCDataStream() vds.write(raw_tx.decode('hex')) - tx = deserialize.parse_Transaction(vds, is_coinbase) + try: + tx = deserialize.parse_Transaction(vds, is_coinbase) + except: + print_log("ERROR: cannot parse", tx_hash) + continue + tx_hashes.append(tx_hash) txdict[tx_hash] = tx is_coinbase = False return tx_hashes, txdict