mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-28 16:01:30 +00:00
wallet.get_relevant_invoice_keys_for_tx: take lock in callee not caller
This commit is contained in:
parent
6b4edc650a
commit
55eb62bb90
1 changed files with 11 additions and 10 deletions
|
@ -766,6 +766,7 @@ class Abstract_Wallet(AddressSynchronizer, ABC):
|
||||||
|
|
||||||
def _get_relevant_invoice_keys_for_tx(self, tx: Transaction) -> Set[str]:
|
def _get_relevant_invoice_keys_for_tx(self, tx: Transaction) -> Set[str]:
|
||||||
relevant_invoice_keys = set()
|
relevant_invoice_keys = set()
|
||||||
|
with self.transaction_lock:
|
||||||
for txout in tx.outputs():
|
for txout in tx.outputs():
|
||||||
for invoice_key in self._invoices_from_scriptpubkey_map.get(txout.scriptpubkey, set()):
|
for invoice_key in self._invoices_from_scriptpubkey_map.get(txout.scriptpubkey, set()):
|
||||||
# note: the invoice might have been deleted since, so check now:
|
# note: the invoice might have been deleted since, so check now:
|
||||||
|
@ -816,8 +817,8 @@ class Abstract_Wallet(AddressSynchronizer, ABC):
|
||||||
return self._is_onchain_invoice_paid(invoice)[0]
|
return self._is_onchain_invoice_paid(invoice)[0]
|
||||||
|
|
||||||
def _maybe_set_tx_label_based_on_invoices(self, tx: Transaction) -> bool:
|
def _maybe_set_tx_label_based_on_invoices(self, tx: Transaction) -> bool:
|
||||||
|
# note: this is not done in 'get_default_label' as that would require deserializing each tx
|
||||||
tx_hash = tx.txid()
|
tx_hash = tx.txid()
|
||||||
with self.transaction_lock:
|
|
||||||
labels = []
|
labels = []
|
||||||
for invoice in self.get_relevant_invoices_for_tx(tx):
|
for invoice in self.get_relevant_invoices_for_tx(tx):
|
||||||
if invoice.message:
|
if invoice.message:
|
||||||
|
|
Loading…
Add table
Reference in a new issue