From: ThomasV Date: Sun, 7 Apr 2013 04:46:25 +0000 (+0400) Subject: stop if an exception occurs other than KeyError X-Git-Url: https://git.novaco.in/?p=electrum-server.git;a=commitdiff_plain;h=115fb7a138829f3bbe28026d0f41dce0a99b46a3 stop if an exception occurs other than KeyError --- diff --git a/backends/bitcoind/blockchain_processor.py b/backends/bitcoind/blockchain_processor.py index c6965d8..9a14ded 100644 --- a/backends/bitcoind/blockchain_processor.py +++ b/backends/bitcoind/blockchain_processor.py @@ -427,6 +427,7 @@ class BlockchainProcessor(Processor): serialized_hist = serialized_hist[0:80*i] + new_item + serialized_hist[80*(i+1):] break else: + self.shared.stop() hist = self.deserialize(serialized_hist) raise BaseException("prevout not found", addr, hist, txi.encode('hex')) @@ -494,10 +495,14 @@ class BlockchainProcessor(Processor): for txi in block_inputs: try: addr = self.db.Get(txi) - except: - # print "addr not in db", txi.encode('hex') + except KeyError: # the input could come from the same block continue + except: + traceback.print_exc(file=sys.stdout) + self.shared.stop() + raise + self.batch_txio[txi] = addr addr_to_read.append(addr) @@ -526,8 +531,12 @@ class BlockchainProcessor(Processor): for addr in addr_to_read: try: self.batch_list[addr] = self.db.Get(addr) - except: + except KeyError: self.batch_list[addr] = '' + except: + traceback.print_exc(file=sys.stdout) + self.shared.stop() + raise # process