update file_reflect

This commit is contained in:
Jack Robison 2019-01-30 14:59:48 -05:00
parent 05915c540a
commit 262b9a624b
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -6,6 +6,7 @@ import inspect
import typing
import aiohttp
import base58
import random
from urllib.parse import urlencode, quote
from typing import Callable, Optional, List
from binascii import hexlify, unhexlify
@ -2788,7 +2789,15 @@ class Daemon(metaclass=JSONRPCServerType):
(list) list of blobs reflected
"""
raise NotImplementedError()
server, port = kwargs.get('server'), kwargs.get('port')
if server and port:
port = int(port)
else:
server, port = random.choice(self.conf.reflector_servers)
return await asyncio.gather(*[
stream.upload_to_reflector(server, port)
for stream in self.stream_manager.get_filtered_streams(**kwargs)
])
@requires(DHT_COMPONENT)
async def jsonrpc_peer_ping(self, node_id, address, port):