shuffle() needs custom random, removed loop from Event()/Queue()

This commit is contained in:
Lex Berezhny 2021-08-21 00:23:27 -04:00
parent 93ab6b3be3
commit 5cb04b86a0
2 changed files with 2 additions and 2 deletions

View file

@ -279,7 +279,7 @@ class ManagedStream(ManagedDownloadSource):
log.info("finished saving file for lbry://%s#%s (sd hash %s...) -> %s", self.claim_name, self.claim_id,
self.sd_hash[:6], self.full_path)
await self.blob_manager.storage.set_saved_file(self.stream_hash)
except Exception as err:
except (Exception, asyncio.CancelledError) as err:
if os.path.isfile(output_path):
log.warning("removing incomplete download %s for %s", output_path, self.sd_hash)
os.remove(output_path)

View file

@ -141,7 +141,7 @@ class CoinSelector:
_) -> List[OutputEffectiveAmountEstimator]:
""" Accumulate UTXOs at random until there is enough to cover the target. """
target = self.target + self.cost_of_change
self.random.shuffle(txos)
self.random.shuffle(txos, random=self.random.random)
selection = []
amount = 0
for coin in txos: