Skip to content

Update network.py wtih get_digest method#106

Open
CodeDruidX wants to merge 1 commit intobmuller:masterfrom
CodeDruidX:patch-1
Open

Update network.py wtih get_digest method#106
CodeDruidX wants to merge 1 commit intobmuller:masterfrom
CodeDruidX:patch-1

Conversation

@CodeDruidX
Copy link

Server node has an ability to set entry in DHT by its key digest representation, but cant get value with it.

Add get_digest method
self.ksize, self.alpha)
return await spider.find()

async def get_digest(self, dkey):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make most sense to remove lines 145 - 155 and replace them with a call to this method (so there isn't any unnecessary duplication).

Returns:
:class:`None` if not found, the value otherwise.
"""
log.info("Looking up key %s", dkey)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
log.info("Looking up key %s", dkey)
log.info("Looking up key digest %s", dkey)

@bmuller
Copy link
Owner

bmuller commented Mar 31, 2025

Are there cases where you know the digest but not the original key? If so - I'm happy to merge w/ the comments here addressed. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants