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"
|
"last_header_height"
|
||||||
private const val PREF_BACKGROUND_TX_HISTORY_VERSION =
|
private const val PREF_BACKGROUND_TX_HISTORY_VERSION =
|
||||||
"background_transaction_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 =
|
private const val PREF_FIAT_CURRENCY =
|
||||||
"preferred_fiat_currency"
|
"preferred_fiat_currency"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ class WalletMonitoringService : Service() {
|
||||||
"background_transaction_history"
|
"background_transaction_history"
|
||||||
private const val PREF_BACKGROUND_TX_HISTORY_VERSION =
|
private const val PREF_BACKGROUND_TX_HISTORY_VERSION =
|
||||||
"background_transaction_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(
|
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 =
|
val mldsaCacheAvailable =
|
||||||
|
!mldsaAddressCreated ||
|
||||||
(0..highestMldsaAddressIndex).all { addressIndex ->
|
(0..highestMldsaAddressIndex).all { addressIndex ->
|
||||||
preferences.contains(
|
preferences.contains(
|
||||||
backgroundUtxoKey(
|
backgroundUtxoKey(
|
||||||
|
|
@ -206,6 +219,7 @@ class WalletMonitoringService : Service() {
|
||||||
}
|
}
|
||||||
|
|
||||||
val slhdsaCacheAvailable =
|
val slhdsaCacheAvailable =
|
||||||
|
!slhdsaAddressCreated ||
|
||||||
(0..highestSlhdsaAddressIndex).all { addressIndex ->
|
(0..highestSlhdsaAddressIndex).all { addressIndex ->
|
||||||
preferences.contains(
|
preferences.contains(
|
||||||
backgroundUtxoKey(
|
backgroundUtxoKey(
|
||||||
|
|
@ -271,12 +285,7 @@ class WalletMonitoringService : Service() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (mldsaAddressCreated) {
|
||||||
preferences.getBoolean(
|
|
||||||
PREF_MLDSA_ADDRESS_CREATED,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
for (
|
for (
|
||||||
addressIndex in
|
addressIndex in
|
||||||
0..highestMldsaAddressIndex
|
0..highestMldsaAddressIndex
|
||||||
|
|
@ -295,12 +304,7 @@ class WalletMonitoringService : Service() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (slhdsaAddressCreated) {
|
||||||
preferences.getBoolean(
|
|
||||||
PREF_SLHDSA_ADDRESS_CREATED,
|
|
||||||
false
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
for (
|
for (
|
||||||
addressIndex in
|
addressIndex in
|
||||||
0..highestSlhdsaAddressIndex
|
0..highestSlhdsaAddressIndex
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue