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

feat(dashpay): add timeskew support to CoinJoinService and warning dialogs #1252

Merged
merged 6 commits into from
Feb 21, 2024

Conversation

HashEngineering
Copy link
Collaborator

Issue being fixed or feature implemented

Related PR's and Dependencies

Screenshots / Videos

How Has This Been Tested?

  • QA (Mobile Team)

Checklist:

  • I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

@HashEngineering HashEngineering self-assigned this Feb 1, 2024
@HashEngineering HashEngineering changed the base branch from master to dashpay February 1, 2024 22:08
Comment on lines -535 to -540
private fun checkLowStorageAlert() {
val stickyIntent = registerReceiver(null, IntentFilter(Intent.ACTION_DEVICE_STORAGE_LOW))
if (stickyIntent != null) {
showLowStorageAlertDialog()
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

DashPay was using the old checkLowStorageAlert()

Comment on lines 394 to 400
val maxAllowedTimeSkew = if (coinJoinConfig.getMode() == CoinJoinMode.NONE) {
TIME_SKEW_TOLERANCE
} else {
TIME_SKEW_TOLERANCE_COINJOIN
}
val timeSkew = abs(systemTimeMillis - networkTime) / 1000
return Pair(timeSkew > maxAllowedTimeSkew, timeSkew)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

for the MainActivity we will show one message if CoinJoin is ON, and another if OFF. Each has different tolerances.

Comment on lines 257 to 286
if (mode == CoinJoinMode.NONE) {
if (mode == CoinJoinMode.NONE || timeSkew > MAX_ALLOWED_TIMESKEW) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we will use timeSkew to determine if CoinJoin will actually run or not.

timeSkew > 2 seconds will give the same result as CoinJoin OFF.

@HashEngineering HashEngineering marked this pull request as ready for review February 14, 2024 17:02
Copy link
Member

@Syn-McJ Syn-McJ left a comment

Choose a reason for hiding this comment

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

Looks good

@HashEngineering HashEngineering merged commit d09b5a6 into dashpay Feb 21, 2024
2 checks passed
@HashEngineering HashEngineering deleted the dashpay-feature-timeskew branch March 19, 2024 13:51
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