mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-02 18:25:21 +00:00
wallet.py: access verified_tx with lock
This commit is contained in:
parent
6bb7558f75
commit
ee9861f0d5
1 changed files with 5 additions and 4 deletions
|
@ -442,7 +442,8 @@ class Abstract_Wallet(PrintError):
|
||||||
def add_unverified_tx(self, tx_hash, tx_height):
|
def add_unverified_tx(self, tx_hash, tx_height):
|
||||||
if tx_height in (TX_HEIGHT_UNCONFIRMED, TX_HEIGHT_UNCONF_PARENT) \
|
if tx_height in (TX_HEIGHT_UNCONFIRMED, TX_HEIGHT_UNCONF_PARENT) \
|
||||||
and tx_hash in self.verified_tx:
|
and tx_hash in self.verified_tx:
|
||||||
self.verified_tx.pop(tx_hash)
|
with self.lock:
|
||||||
|
self.verified_tx.pop(tx_hash)
|
||||||
if self.verifier:
|
if self.verifier:
|
||||||
self.verifier.merkle_roots.pop(tx_hash, None)
|
self.verifier.merkle_roots.pop(tx_hash, None)
|
||||||
|
|
||||||
|
@ -1321,7 +1322,8 @@ class Abstract_Wallet(PrintError):
|
||||||
# remain so they will be GC-ed
|
# remain so they will be GC-ed
|
||||||
self.storage.put('stored_height', self.get_local_height())
|
self.storage.put('stored_height', self.get_local_height())
|
||||||
self.save_transactions()
|
self.save_transactions()
|
||||||
self.storage.put('verified_tx3', self.verified_tx)
|
with self.lock:
|
||||||
|
self.storage.put('verified_tx3', self.verified_tx)
|
||||||
self.storage.write()
|
self.storage.write()
|
||||||
|
|
||||||
def wait_until_synchronized(self, callback=None):
|
def wait_until_synchronized(self, callback=None):
|
||||||
|
@ -1963,8 +1965,7 @@ class Imported_Wallet(Simple_Wallet):
|
||||||
self.unverified_tx.pop(tx_hash, None)
|
self.unverified_tx.pop(tx_hash, None)
|
||||||
self.transactions.pop(tx_hash, None)
|
self.transactions.pop(tx_hash, None)
|
||||||
# FIXME: what about pruned_txo?
|
# FIXME: what about pruned_txo?
|
||||||
|
self.storage.put('verified_tx3', self.verified_tx)
|
||||||
self.storage.put('verified_tx3', self.verified_tx)
|
|
||||||
self.save_transactions()
|
self.save_transactions()
|
||||||
|
|
||||||
self.set_label(address, None)
|
self.set_label(address, None)
|
||||||
|
|
Loading…
Add table
Reference in a new issue