mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-01 09:45:18 +00:00
wallet.py: remove local transactions that we don't have
fixes #4232 closes #4234
This commit is contained in:
parent
7dcefd999f
commit
1935d7d165
1 changed files with 8 additions and 0 deletions
|
@ -219,6 +219,7 @@ class Abstract_Wallet(PrintError):
|
||||||
self.load_unverified_transactions()
|
self.load_unverified_transactions()
|
||||||
self.load_local_history()
|
self.load_local_history()
|
||||||
self.build_spent_outpoints()
|
self.build_spent_outpoints()
|
||||||
|
self.remove_local_transactions_we_dont_have()
|
||||||
|
|
||||||
# there is a difference between wallet.up_to_date and interface.is_up_to_date()
|
# there is a difference between wallet.up_to_date and interface.is_up_to_date()
|
||||||
# interface.is_up_to_date() returns true when all requests have been answered and processed
|
# interface.is_up_to_date() returns true when all requests have been answered and processed
|
||||||
|
@ -267,6 +268,13 @@ class Abstract_Wallet(PrintError):
|
||||||
for txid in itertools.chain(self.txi, self.txo):
|
for txid in itertools.chain(self.txi, self.txo):
|
||||||
self._add_tx_to_local_history(txid)
|
self._add_tx_to_local_history(txid)
|
||||||
|
|
||||||
|
def remove_local_transactions_we_dont_have(self):
|
||||||
|
txid_set = set(self.txi) | set(self.txo)
|
||||||
|
for txid in txid_set:
|
||||||
|
tx_height = self.get_tx_height(txid)[0]
|
||||||
|
if tx_height == TX_HEIGHT_LOCAL and txid not in self.transactions:
|
||||||
|
self.remove_transaction(txid)
|
||||||
|
|
||||||
@profiler
|
@profiler
|
||||||
def save_transactions(self, write=False):
|
def save_transactions(self, write=False):
|
||||||
with self.transaction_lock:
|
with self.transaction_lock:
|
||||||
|
|
Loading…
Add table
Reference in a new issue