Skip to content
Merged
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
8 changes: 4 additions & 4 deletions Bitkit/Services/CoreService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}
}
await MainActor.run {
self.cachedTxIdsInBoostTxIds = txIds

Check warning on line 57 in Bitkit/Services/CoreService.swift

View workflow job for this annotation

GitHub Actions / Run Tests

reference to captured var 'txIds' in concurrently-executing code; this is an error in the Swift 6 language mode
}
} catch {
Logger.error("Failed to refresh boostTxIds cache: \(error)", context: "ActivityService")
Expand Down Expand Up @@ -105,7 +105,7 @@
return false
}
}
} catch {

Check warning on line 108 in Bitkit/Services/CoreService.swift

View workflow job for this annotation

GitHub Actions / Run Tests

'catch' block is unreachable because no errors are thrown in 'do' block
Logger.error("Failed to check existing activities for replacement: \(error)", context: "CoreService.shouldShowReceivedSheet")
}

Expand Down Expand Up @@ -356,6 +356,7 @@

// Mark the replaced transaction as not existing
existing.doesExist = false
existing.isBoosted = false
existing.updatedAt = UInt64(Date().timeIntervalSince1970)
try await self.update(id: existing.id, activity: .onchain(existing))
Logger.info("Marked transaction \(txid) as replaced", context: "CoreService.handleOnchainTransactionReplaced")
Expand Down Expand Up @@ -480,7 +481,7 @@
}

private func processLightningPayment(_ payment: PaymentDetails) async throws {
guard case let .bolt11(hash, preimage, secret, description, bolt11) = payment.kind else { return }

Check warning on line 484 in Bitkit/Services/CoreService.swift

View workflow job for this annotation

GitHub Actions / Run Tests

immutable value 'secret' was never used; consider replacing with '_' or removing it

Check warning on line 484 in Bitkit/Services/CoreService.swift

View workflow job for this annotation

GitHub Actions / Run Tests

immutable value 'hash' was never used; consider replacing with '_' or removing it

// Skip pending inbound payments - just means they created an invoice
guard !(payment.status == .pending && payment.direction == .inbound) else { return }
Expand Down Expand Up @@ -534,7 +535,7 @@

for payment in payments {
do {
let state: BitkitCore.PaymentState = switch payment.status {

Check warning on line 538 in Bitkit/Services/CoreService.swift

View workflow job for this annotation

GitHub Actions / Run Tests

immutable value 'state' was never used; consider replacing with '_' or removing it
case .failed:
.failed
case .pending:
Expand Down Expand Up @@ -570,7 +571,7 @@
latestCaughtError = error
}
}
} catch {

Check warning on line 574 in Bitkit/Services/CoreService.swift

View workflow job for this annotation

GitHub Actions / Run Tests

'catch' block is unreachable because no errors are thrown in 'do' block
Logger.error("Error syncing LDK payment: \(error)", context: "CoreService")
latestCaughtError = error
}
Expand Down Expand Up @@ -603,7 +604,7 @@
/// Check if a transaction spends a closed channel's funding UTXO
private func findClosedChannelForTransaction(txid: String, transactionDetails: TransactionDetails? = nil) async -> String? {
do {
let closedChannels = try await getAllClosedChannels(sortDirection: .desc)

Check warning on line 607 in Bitkit/Services/CoreService.swift

View workflow job for this annotation

GitHub Actions / Run Tests

no 'async' operations occur within 'await' expression
guard !closedChannels.isEmpty else { return nil }

// Use provided transaction details if available, otherwise try node
Expand Down Expand Up @@ -998,12 +999,11 @@

Logger.info("RBF transaction created successfully: \(txid)", context: "CoreService.boostOnchainTransaction")

// For RBF, mark the original activity as doesExist = false instead of deleting it
// This allows it to be displayed with the "removed" status
onchainActivity.doesExist = false
// For RBF, mark the original activity as boosted until the replacement comes
onchainActivity.isBoosted = true
try await self.update(id: activityId, activity: .onchain(onchainActivity))
Logger.info(
"Successfully marked activity \(activityId) as doesExist = false (replaced by RBF)",
"Successfully marked activity \(activityId) as replaced by fee",
context: "CoreService.boostOnchainTransaction"
)
}
Expand Down
4 changes: 0 additions & 4 deletions Bitkit/ViewModels/AppViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,6 @@ extension AppViewModel {

await MainActor.run {
if !shouldShow {
Logger.info(
"Skipping received sheet for RBF replacement with same value: \(txid)",
context: "AppViewModel"
)
return
}

Expand Down
Loading