mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 09:21:39 +00:00
synchronizer: more batching
This commit is contained in:
parent
c49e563881
commit
b33b2c0945
1 changed files with 4 additions and 3 deletions
|
@ -118,11 +118,12 @@ class Synchronizer(PrintError):
|
|||
transaction_hashes.append(tx_hash)
|
||||
self.requested_tx[tx_hash] = tx_height
|
||||
|
||||
for tx_hash in transaction_hashes:
|
||||
await self.get_transaction(tx_hash)
|
||||
async with TaskGroup() as group:
|
||||
for tx_hash in transaction_hashes:
|
||||
await group.spawn(self.get_transaction, tx_hash)
|
||||
|
||||
async def get_transaction(self, tx_hash):
|
||||
result = await self.session.send_request('blockchain.transaction.get', [tx_hash])
|
||||
result = await asyncio.wait_for(self.session.send_request('blockchain.transaction.get', [tx_hash]), 20)
|
||||
tx = Transaction(result)
|
||||
try:
|
||||
tx.deserialize()
|
||||
|
|
Loading…
Add table
Reference in a new issue