From 49714a45e67ca125414f3f31c8dfe1b9b3c8cfe8 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Thu, 15 Dec 2016 16:56:37 +0900 Subject: [PATCH] Mempool tx processing to handle DBError Fixes #74 --- server/mempool.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/mempool.py b/server/mempool.py index 0f0f283..ce149f3 100644 --- a/server/mempool.py +++ b/server/mempool.py @@ -242,10 +242,11 @@ class MemPool(util.LoggedClass): elif not mempool_missing: prev_hash = hex_str_to_hash(prev_hex_hash) txin_pairs.append(db_utxo_lookup(prev_hash, prev_idx)) - except self.db.MissingUTXOError: - # This typically happens just after the daemon has - # accepted a new block and the new mempool has deps on - # new txs in that block. + except (self.db.MissingUTXOError, self.db.DBError): + # DBError can happen when flushing a newly processed + # block. MissingUTXOError typically happens just + # after the daemon has accepted a new block and the + # new mempool has deps on new txs in that block. continue if mempool_missing: