1
0

network: randomise the order of address subscriptions

Before this, we were subscribing to our addresses in their bip32 order,
leaking this information to servers. While this leak seems mostly harmless,
it is trivial to fix.
This commit is contained in:
SomberNight
2020-06-17 19:25:52 +02:00
parent 2580832a88
commit 2c962abe51
4 changed files with 18 additions and 9 deletions

View File

@@ -32,7 +32,7 @@ from aiorpcx import TaskGroup, run_in_thread, RPCError
from . import util
from .transaction import Transaction, PartialTransaction
from .util import bh2u, make_aiohttp_session, NetworkJobOnDefaultServer
from .util import bh2u, make_aiohttp_session, NetworkJobOnDefaultServer, random_shuffled_copy
from .bitcoin import address_to_scripthash, is_address
from .network import UntrustedServerReturnedError
from .logging import Logger
@@ -240,7 +240,7 @@ class Synchronizer(SynchronizerBase):
if history == ['*']: continue
await self._request_missing_txs(history, allow_server_not_finding_tx=True)
# add addresses to bootstrap
for addr in self.wallet.get_addresses():
for addr in random_shuffled_copy(self.wallet.get_addresses()):
await self._add_address(addr)
# main loop
while True: