Add download replies button (#965)

* Add download replies rpc command

* Add download replies button to squeak page

* Use reply to hash in lookup query

* Update frontend build
This commit is contained in:
Jonathan Zernik 2021-08-17 23:00:58 -07:00 committed by GitHub
parent 95176be9c0
commit bf6fbc0ab7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 179 additions and 71 deletions

View file

@ -510,11 +510,13 @@ class SqueakController:
address: str,
min_block: int,
max_block: int,
reply_to_hash: bytes,
):
return self.squeak_db.lookup_squeaks(
[address],
min_block,
max_block,
reply_to_hash,
)
def filter_known_invs(self, invs):
@ -583,6 +585,23 @@ class SqueakController:
getdata_msg = msg_getdata(inv=invs)
self.broadcast_msg(getdata_msg)
def download_replies(self, squeak_hash: bytes):
logger.info("Downloading replies for squeak: {}".format(
squeak_hash.hex(),
))
interests = [
CInterested(
hashReplySqk=squeak_hash,
)
]
locator = CSqueakLocator(
vInterested=interests,
)
getsqueaks_msg = msg_getsqueaks(
locator=locator,
)
self.broadcast_msg(getsqueaks_msg)
def filter_shared_squeak_locator(self, interests: List[CInterested]):
ret = []
block_range = self.get_block_range()