mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-02 18:25:21 +00:00
add_future_tx should return success
This commit is contained in:
parent
64a8de8bae
commit
9616333b39
2 changed files with 9 additions and 5 deletions
|
@ -587,8 +587,10 @@ class AddressSynchronizer(Logger):
|
|||
def add_future_tx(self, tx: Transaction, num_blocks: int) -> None:
|
||||
assert num_blocks > 0, num_blocks
|
||||
with self.lock:
|
||||
self.add_transaction(tx)
|
||||
self.future_tx[tx.txid()] = num_blocks
|
||||
tx_was_added = self.add_transaction(tx)
|
||||
if tx_was_added:
|
||||
self.future_tx[tx.txid()] = num_blocks
|
||||
return tx_was_added
|
||||
|
||||
def get_tx_height(self, tx_hash: str) -> TxMinedInfo:
|
||||
with self.lock:
|
||||
|
|
|
@ -407,8 +407,10 @@ class LNWalletWatcher(LNWatcher):
|
|||
else:
|
||||
# it's OK to add local transaction, the fee will be recomputed
|
||||
try:
|
||||
self.lnworker.wallet.add_future_tx(tx, remaining)
|
||||
self.logger.info(f'adding future tx: {name}. prevout: {prevout}')
|
||||
self.network.trigger_callback('wallet_updated', self.lnworker.wallet)
|
||||
tx_was_added = self.lnworker.wallet.add_future_tx(tx, remaining)
|
||||
except Exception as e:
|
||||
self.logger.info(f'could not add future tx: {name}. prevout: {prevout} {str(e)}')
|
||||
tx_was_added = False
|
||||
if tx_was_added:
|
||||
self.logger.info(f'added future tx: {name}. prevout: {prevout}')
|
||||
self.network.trigger_callback('wallet_updated', self.lnworker.wallet)
|
||||
|
|
Loading…
Add table
Reference in a new issue