def iter_used_addresses(adapter, seed, start):
# type: (BaseAdapter, Seed, int) -> Generator[Tuple[Address, List[TransactionHash]]]
"""
Scans the Tangle for used addresses.
This is basically the opposite of invoking ``getNewAddresses`` with
``stop=None``.
"""
ft_command = FindTransactionsCommand(adapter)
for addy in AddressGenerator(seed).create_iterator(start):
ft_response = ft_command(addresses=[addy])
if ft_response['hashes']:
yield addy, ft_response['hashes']
else:
break
# Reset the command so that we can call it again.
ft_command.reset()
评论列表
文章目录