fix parameter
This commit is contained in:
parent
b9e913ddc7
commit
0aaa2ecaed
1 changed files with 4 additions and 4 deletions
|
@ -683,7 +683,7 @@ class Ledger(metaclass=LedgerRegistry):
|
||||||
tx.position = merkle['pos']
|
tx.position = merkle['pos']
|
||||||
tx.is_verified = merkle_root == header['merkle_root']
|
tx.is_verified = merkle_root == header['merkle_root']
|
||||||
|
|
||||||
async def request_transactions(self, to_request: Tuple[Tuple[str, int], ...]):
|
async def request_transactions(self, to_request: Tuple[Tuple[str, int], ...], session=None):
|
||||||
batches = [[]]
|
batches = [[]]
|
||||||
remote_heights = {}
|
remote_heights = {}
|
||||||
|
|
||||||
|
@ -696,7 +696,7 @@ class Ledger(metaclass=LedgerRegistry):
|
||||||
batches.pop()
|
batches.pop()
|
||||||
|
|
||||||
for batch in batches:
|
for batch in batches:
|
||||||
async for tx in self._single_batch(batch, remote_heights):
|
async for tx in self._single_batch(batch, remote_heights, session):
|
||||||
yield tx
|
yield tx
|
||||||
|
|
||||||
async def request_synced_transactions(self, to_request, remote_history, address):
|
async def request_synced_transactions(self, to_request, remote_history, address):
|
||||||
|
@ -706,8 +706,8 @@ class Ledger(metaclass=LedgerRegistry):
|
||||||
yield tx
|
yield tx
|
||||||
await asyncio.gather(*pending_sync)
|
await asyncio.gather(*pending_sync)
|
||||||
|
|
||||||
async def _single_batch(self, batch, remote_heights):
|
async def _single_batch(self, batch, remote_heights, session):
|
||||||
batch_result = await self.network.retriable_call(self.network.get_transaction_batch, batch)
|
batch_result = await self.network.retriable_call(self.network.get_transaction_batch, batch, session)
|
||||||
for txid, (raw, merkle) in batch_result.items():
|
for txid, (raw, merkle) in batch_result.items():
|
||||||
remote_height = remote_heights[txid]
|
remote_height = remote_heights[txid]
|
||||||
tx = Transaction(unhexlify(raw), height=remote_height)
|
tx = Transaction(unhexlify(raw), height=remote_height)
|
||||||
|
|
Loading…
Add table
Reference in a new issue