-
Notifications
You must be signed in to change notification settings - Fork 171
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
Conversation
private fun checkLowStorageAlert() { | ||
val stickyIntent = registerReceiver(null, IntentFilter(Intent.ACTION_DEVICE_STORAGE_LOW)) | ||
if (stickyIntent != null) { | ||
showLowStorageAlertDialog() | ||
} | ||
} |
There was a problem hiding this comment.
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()
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) |
There was a problem hiding this comment.
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.
if (mode == CoinJoinMode.NONE) { | ||
if (mode == CoinJoinMode.NONE || timeSkew > MAX_ALLOWED_TIMESKEW) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Issue being fixed or feature implemented
Related PR's and Dependencies
Screenshots / Videos
How Has This Been Tested?
Checklist: