Skip to content

Commit 9f7e7e6

Browse files
authored
Merge pull request #532 from synonymdev/feat/spend-unconfirmed
2 parents 72a627f + a69bab3 commit 9f7e7e6

File tree

3 files changed

+1
-17
lines changed

3 files changed

+1
-17
lines changed

app/src/main/java/to/bitkit/data/CacheStore.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ class CacheStore @Inject constructor(
9898
}
9999
}
100100

101-
suspend fun setLastLightningPayment(paymentId: String) {
102-
store.updateData { it.copy(lastLightningPaymentId = paymentId) }
103-
}
104-
105101
suspend fun setBackgroundReceive(details: NewTransactionSheetDetails) = store.updateData {
106102
it.copy(backgroundReceive = details)
107103
}
@@ -130,7 +126,6 @@ data class AppCacheData(
130126
val balance: BalanceState? = null,
131127
val backupStatuses: Map<BackupCategory, BackupItemStatus> = mapOf(),
132128
val deletedActivities: List<String> = listOf(),
133-
val lastLightningPaymentId: String? = null,
134129
val pendingBoostActivities: List<PendingBoostActivity> = listOf(),
135130
val backgroundReceive: NewTransactionSheetDetails? = null,
136131
) {

app/src/main/java/to/bitkit/services/LightningService.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ class LightningService @Inject constructor(
108108
trustedPeersNoReserve = trustedPeerNodeIds,
109109
perChannelReserveSats = 1u,
110110
),
111+
includeUntrustedPendingInSpendable = true,
111112
)
112113
}
113114

app/src/main/java/to/bitkit/viewmodels/AppViewModel.kt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -382,20 +382,8 @@ class AppViewModel @Inject constructor(
382382

383383
private suspend fun notifyPaymentReceived(event: Event) {
384384
val command = NotifyPaymentReceived.Command.from(event) ?: return
385-
if (command is NotifyPaymentReceived.Command.Lightning) {
386-
val cachedId = cacheStore.data.first().lastLightningPaymentId
387-
// Skip if this is a replay by ldk-node on startup
388-
if (command.event.paymentHash == cachedId) {
389-
Logger.debug("Skipping notification for replayed event: $event", context = TAG)
390-
return
391-
}
392-
// Cache to skip later as needed
393-
cacheStore.setLastLightningPayment(command.event.paymentHash)
394-
}
395-
396385
val result = notifyPaymentReceivedHandler(command).getOrNull()
397386
if (result !is NotifyPaymentReceived.Result.ShowSheet) return
398-
399387
showTransactionSheet(result.sheet)
400388
}
401389

0 commit comments

Comments
 (0)