Fixed encrypted uploads

This commit is contained in:
Kevin Froman 2020-10-10 08:41:55 +00:00
parent 0338cd64b6
commit 5baa048a4e
3 changed files with 8 additions and 6 deletions

View file

@ -67,10 +67,11 @@ def upload_blocks_from_communicator(comm_inst: 'OnionrCommunicatorDaemon'):
session = session_manager.add_session(bl)
for _ in range(min(len(kv.get('onlinePeers')), 6)):
try:
peer = onlinepeers.pick_online_peer(kv)
if peer in kv.get('plaintextDisabledPeers'):
logger.info(f"Cannot upload plaintext block to peer that denies it {peer}") # noqa
continue
if not block.Block(bl).isEncrypted():
peer = onlinepeers.pick_online_peer(kv)
if peer in kv.get('plaintextDisabledPeers'):
logger.info(f"Cannot upload plaintext block to peer that denies it {peer}") # noqa
continue
except onionrexceptions.OnlinePeerNeeded:
continue
try: