mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-05 05:15:12 +00:00
simplify add_transaction
This commit is contained in:
parent
63e402c2d7
commit
76bf53b262
1 changed files with 2 additions and 6 deletions
|
@ -735,15 +735,11 @@ class Abstract_Wallet(PrintError):
|
||||||
# this outpoint (ser) has already been spent, by spending_tx
|
# this outpoint (ser) has already been spent, by spending_tx
|
||||||
assert spending_tx_hash in self.transactions
|
assert spending_tx_hash in self.transactions
|
||||||
conflicting_txns |= {spending_tx_hash}
|
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
|
return conflicting_txns
|
||||||
|
|
||||||
def add_transaction(self, tx_hash, tx):
|
def add_transaction(self, tx_hash, tx):
|
||||||
|
if tx in self.transactions:
|
||||||
|
return True
|
||||||
is_coinbase = tx.inputs()[0]['type'] == 'coinbase'
|
is_coinbase = tx.inputs()[0]['type'] == 'coinbase'
|
||||||
related = False
|
related = False
|
||||||
with self.transaction_lock:
|
with self.transaction_lock:
|
||||||
|
|
Loading…
Add table
Reference in a new issue