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())
|
||||
|
||||
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
|
||||
addresses = set()
|
||||
for txi in tx.inputs:
|
||||
|
@ -653,6 +654,7 @@ class Ledger(metaclass=LedgerRegistry):
|
|||
start = int(time.perf_counter())
|
||||
while timeout and (int(time.perf_counter()) - start) <= timeout:
|
||||
if await self._wait_round(tx, height, addresses):
|
||||
log.info("got reply for tx %s with timeout %s seconds", tx.id, timeout)
|
||||
return
|
||||
raise asyncio.TimeoutError('Timed out waiting for transaction.')
|
||||
|
||||
|
@ -675,7 +677,7 @@ class Ledger(metaclass=LedgerRegistry):
|
|||
if txid == tx.id and local_height >= height:
|
||||
found = True
|
||||
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 True
|
||||
|
||||
|
|
|
@ -298,7 +298,9 @@ class WalletManager:
|
|||
|
||||
async def broadcast_or_release(self, tx, blocking=False):
|
||||
try:
|
||||
log.info("broadcasting %s", tx.id)
|
||||
await self.ledger.broadcast(tx)
|
||||
log.info("broadcasted %s", tx.id)
|
||||
if blocking:
|
||||
await self.ledger.wait(tx, timeout=None)
|
||||
except:
|
||||
|
|
Loading…
Add table
Reference in a new issue