tsimplify add_transaction - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 76bf53b2624813a4b4e95d1b59bdc2b19673d3d9 DIR parent 63e402c2d7c063d5f078968c338534337fe89545 HTML Author: ThomasV <thomasv@electrum.org> Date: Fri, 16 Feb 2018 13:54:18 +0100 simplify add_transaction Diffstat: M lib/wallet.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) --- DIR diff --git a/lib/wallet.py b/lib/wallet.py t@@ -735,15 +735,11 @@ class Abstract_Wallet(PrintError): # this outpoint (ser) has already been spent, by spending_tx assert spending_tx_hash in self.transactions conflicting_txns |= {spending_tx_hash} - txid = tx.txid() - if txid in conflicting_txns: - # this tx is already in history, so it conflicts with itself - if len(conflicting_txns) > 1: - raise Exception('Found conflicting transactions already in wallet history.') - conflicting_txns -= {txid} return conflicting_txns def add_transaction(self, tx_hash, tx): + if tx in self.transactions: + return True is_coinbase = tx.inputs()[0]['type'] == 'coinbase' related = False with self.transaction_lock: