mirror of
https://github.com/LBRYFoundation/lbry-sdk.git
synced 2025-09-01 09:45:13 +00:00
more logs
This commit is contained in:
parent
46ef6c8ab7
commit
f5ccb8efdc
2 changed files with 5 additions and 1 deletions
|
@ -640,6 +640,7 @@ class Ledger(metaclass=LedgerRegistry):
|
||||||
return self.network.broadcast(hexlify(tx.raw).decode())
|
return self.network.broadcast(hexlify(tx.raw).decode())
|
||||||
|
|
||||||
async def wait(self, tx: Transaction, height=-1, timeout=1):
|
async def wait(self, tx: Transaction, height=-1, timeout=1):
|
||||||
|
log.info("waiting for tx %s with timeout %s seconds", tx.id, timeout)
|
||||||
timeout = timeout or 600 # after 10 minutes there is almost 0 hope
|
timeout = timeout or 600 # after 10 minutes there is almost 0 hope
|
||||||
addresses = set()
|
addresses = set()
|
||||||
for txi in tx.inputs:
|
for txi in tx.inputs:
|
||||||
|
@ -653,6 +654,7 @@ class Ledger(metaclass=LedgerRegistry):
|
||||||
start = int(time.perf_counter())
|
start = int(time.perf_counter())
|
||||||
while timeout and (int(time.perf_counter()) - start) <= timeout:
|
while timeout and (int(time.perf_counter()) - start) <= timeout:
|
||||||
if await self._wait_round(tx, height, addresses):
|
if await self._wait_round(tx, height, addresses):
|
||||||
|
log.info("got reply for tx %s with timeout %s seconds", tx.id, timeout)
|
||||||
return
|
return
|
||||||
raise asyncio.TimeoutError('Timed out waiting for transaction.')
|
raise asyncio.TimeoutError('Timed out waiting for transaction.')
|
||||||
|
|
||||||
|
@ -675,7 +677,7 @@ class Ledger(metaclass=LedgerRegistry):
|
||||||
if txid == tx.id and local_height >= height:
|
if txid == tx.id and local_height >= height:
|
||||||
found = True
|
found = True
|
||||||
if not found:
|
if not found:
|
||||||
log.debug("timeout: %s, %s, %s", record['history'], addresses, tx.id)
|
log.info("timeout: %s, %s, %s", record['history'], addresses, tx.id)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -298,7 +298,9 @@ class WalletManager:
|
||||||
|
|
||||||
async def broadcast_or_release(self, tx, blocking=False):
|
async def broadcast_or_release(self, tx, blocking=False):
|
||||||
try:
|
try:
|
||||||
|
log.info("broadcasting %s", tx.id)
|
||||||
await self.ledger.broadcast(tx)
|
await self.ledger.broadcast(tx)
|
||||||
|
log.info("broadcasted %s", tx.id)
|
||||||
if blocking:
|
if blocking:
|
||||||
await self.ledger.wait(tx, timeout=None)
|
await self.ledger.wait(tx, timeout=None)
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Add table
Reference in a new issue