Fix PQ background cache handling and rescan version
This commit is contained in:
parent
7a2abc0115
commit
e27f5ef27d
2 changed files with 32 additions and 28 deletions
|
|
@ -124,7 +124,7 @@ class WalletActivity : FragmentActivity() {
|
|||
"last_header_height"
|
||||
private const val PREF_BACKGROUND_TX_HISTORY_VERSION =
|
||||
"background_transaction_history_version"
|
||||
private const val BACKGROUND_TX_HISTORY_VERSION = 4
|
||||
private const val BACKGROUND_TX_HISTORY_VERSION = 5
|
||||
private const val PREF_FIAT_CURRENCY =
|
||||
"preferred_fiat_currency"
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class WalletMonitoringService : Service() {
|
|||
"background_transaction_history"
|
||||
private const val PREF_BACKGROUND_TX_HISTORY_VERSION =
|
||||
"background_transaction_history_version"
|
||||
private const val BACKGROUND_TX_HISTORY_VERSION = 4
|
||||
private const val BACKGROUND_TX_HISTORY_VERSION = 5
|
||||
}
|
||||
|
||||
private fun backgroundUtxoKey(
|
||||
|
|
@ -195,7 +195,20 @@ class WalletMonitoringService : Service() {
|
|||
)
|
||||
}
|
||||
|
||||
val mldsaAddressCreated =
|
||||
preferences.getBoolean(
|
||||
PREF_MLDSA_ADDRESS_CREATED,
|
||||
false
|
||||
)
|
||||
|
||||
val slhdsaAddressCreated =
|
||||
preferences.getBoolean(
|
||||
PREF_SLHDSA_ADDRESS_CREATED,
|
||||
false
|
||||
)
|
||||
|
||||
val mldsaCacheAvailable =
|
||||
!mldsaAddressCreated ||
|
||||
(0..highestMldsaAddressIndex).all { addressIndex ->
|
||||
preferences.contains(
|
||||
backgroundUtxoKey(
|
||||
|
|
@ -206,6 +219,7 @@ class WalletMonitoringService : Service() {
|
|||
}
|
||||
|
||||
val slhdsaCacheAvailable =
|
||||
!slhdsaAddressCreated ||
|
||||
(0..highestSlhdsaAddressIndex).all { addressIndex ->
|
||||
preferences.contains(
|
||||
backgroundUtxoKey(
|
||||
|
|
@ -271,12 +285,7 @@ class WalletMonitoringService : Service() {
|
|||
)
|
||||
}
|
||||
|
||||
if (
|
||||
preferences.getBoolean(
|
||||
PREF_MLDSA_ADDRESS_CREATED,
|
||||
false
|
||||
)
|
||||
) {
|
||||
if (mldsaAddressCreated) {
|
||||
for (
|
||||
addressIndex in
|
||||
0..highestMldsaAddressIndex
|
||||
|
|
@ -295,12 +304,7 @@ class WalletMonitoringService : Service() {
|
|||
}
|
||||
}
|
||||
|
||||
if (
|
||||
preferences.getBoolean(
|
||||
PREF_SLHDSA_ADDRESS_CREATED,
|
||||
false
|
||||
)
|
||||
) {
|
||||
if (slhdsaAddressCreated) {
|
||||
for (
|
||||
addressIndex in
|
||||
0..highestSlhdsaAddressIndex
|
||||
|
|
|
|||
Loading…
Reference in a new issue