Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[multi-device] Shorter TTL for pairing requests #454

Merged
merged 2 commits into from
Sep 2, 2019

Conversation

sachaaaaa
Copy link

Since the pairing process should be done with both devices online, the pairing request message should have a short TTL. I've set it to 2 minutes. The timeout for receiving the grant message back on the secondary device is 1 minute, so this leaves 30 seconds for messages to travel in each direction.
Also, I've replaced a if/else if statement with a switch and moved that into a local function to allow returning the values. This makes the thing slightly more robust against forgetting break's, even though usually IDE's and linters pick this error up easily.

Copy link

@BeaudanBrown BeaudanBrown left a comment

Choose a reason for hiding this comment

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

Straight forward

Copy link

@BeaudanBrown BeaudanBrown left a comment

Choose a reason for hiding this comment

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

Straight forward

@sachaaaaa sachaaaaa changed the title Shorter TTL for pairing requests [multi-device] Shorter TTL for pairing requests Aug 30, 2019
@sachaaaaa sachaaaaa merged commit fbe0cbd into oxen-io:multi-device Sep 2, 2019
@sachaaaaa sachaaaaa deleted the short_ttl branch September 2, 2019 00:25
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.

None yet

2 participants