Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ dependencies {
implementation(libs.vss.client)
nativeDebugSymbols(libs.bitkit.core.nativeDebugSymbolsArtifact())
nativeDebugSymbols(libs.ldk.node.android.nativeDebugSymbolsArtifact())
nativeDebugSymbols(libs.paykit.nativeDebugSymbolsArtifact())
nativeDebugSymbols(libs.vss.client.nativeDebugSymbolsArtifact())
// Firebase
implementation(platform(libs.firebase.bom))
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/to/bitkit/data/PrivatePaykitStores.kt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ data class PrivatePaykitCacheData(
@Serializable
data class PrivatePaykitContactCacheData(
val remoteEndpoints: List<PrivatePaykitStoredPaymentEntryData> = emptyList(),
val remotePaymentListVersionsByReceiverPath: Map<String, ULong> = emptyMap(),
val consumedPaymentListVersionsByReceiverPath: Map<String, ULong> = emptyMap(),
val localInvoicesByReceiverPath: Map<String, PrivatePaykitStoredInvoiceData> = emptyMap(),
val receivedInvoicePaymentHashes: List<String> = emptyList(),
val publishedPrivatePaymentReceiverPaths: Set<String> = emptySet(),
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/to/bitkit/data/keychain/Keychain.kt
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ class Keychain @Inject constructor(
PIN,
PIN_ATTEMPTS_REMAINING,
PAYKIT_SESSION,
PAYKIT_RECEIVER_NOISE_SECRET_KEY,
PAYKIT_SDK_STATE,
PUBKY_SECRET_KEY,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ internal data class PrivatePaykitState(

internal data class ContactState(
var remoteEndpoints: List<StoredPaymentEntry> = emptyList(),
var remotePaymentListVersionsByReceiverPath: Map<String, ULong> = emptyMap(),
var consumedPaymentListVersionsByReceiverPath: Map<String, ULong> = emptyMap(),
var localInvoicesByReceiverPath: Map<String, StoredInvoice> = emptyMap(),
var receivedInvoicePaymentHashes: List<String> = emptyList(),
var publishedPrivatePaymentReceiverPaths: Set<String> = emptySet(),
) {
constructor(cache: PrivatePaykitContactCacheData) : this(
remoteEndpoints = cache.remoteEndpoints.map { StoredPaymentEntry(it.methodId, it.endpointData) },
remotePaymentListVersionsByReceiverPath = cache.remotePaymentListVersionsByReceiverPath,
consumedPaymentListVersionsByReceiverPath = cache.consumedPaymentListVersionsByReceiverPath,
localInvoicesByReceiverPath = cache.localInvoicesByReceiverPath.mapValues { (_, invoice) ->
StoredInvoice(invoice.bolt11, invoice.paymentHash, invoice.expiresAt)
},
Expand All @@ -48,11 +52,15 @@ internal data class ContactState(
val hasCacheState: Boolean
get() = publishedPrivatePaymentReceiverPaths.isNotEmpty() ||
remoteEndpoints.isNotEmpty() ||
remotePaymentListVersionsByReceiverPath.isNotEmpty() ||
consumedPaymentListVersionsByReceiverPath.isNotEmpty() ||
localInvoicesByReceiverPath.isNotEmpty() ||
receivedInvoicePaymentHashes.isNotEmpty()

fun cacheState() = PrivatePaykitContactCacheData(
remoteEndpoints = remoteEndpoints.map { PrivatePaykitStoredPaymentEntryData(it.methodId, it.endpointData) },
remotePaymentListVersionsByReceiverPath = remotePaymentListVersionsByReceiverPath,
consumedPaymentListVersionsByReceiverPath = consumedPaymentListVersionsByReceiverPath,
localInvoicesByReceiverPath = localInvoicesByReceiverPath.mapValues { (_, invoice) ->
PrivatePaykitStoredInvoiceData(invoice.bolt11, invoice.paymentHash, invoice.expiresAt)
},
Expand Down
170 changes: 142 additions & 28 deletions app/src/main/java/to/bitkit/repositories/PrivatePaykitRepo.kt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions app/src/main/java/to/bitkit/services/LightningService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ class LightningService @Inject constructor(
feeRateCacheUpdateIntervalSecs = Env.walletSyncIntervalSecs,
),
connectionTimeoutSecs = Env.walletSyncTimeoutSecs,
additionalWalletFullScanBatchSize = 5u,
additionalWalletFullScanStopGap = 20u,
),
)
}
Expand Down
Loading
Loading