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
11 changes: 7 additions & 4 deletions Bitkit/Constants/Env.swift
Original file line number Diff line number Diff line change
Expand Up @@ -183,18 +183,21 @@ enum Env {

static var blocktankBaseUrl: String {
switch network {
case .bitcoin: "https://api1.blocktank.to/api"
default: "https://api.stag0.blocktank.to/"
case .bitcoin: "https://api1.blocktank.to"
default: "https://api.stag0.blocktank.to"
}
}

static var blocktankPushNotificationServer: String {
"\(blocktankBaseUrl)/notifications/api"
switch network {
case .bitcoin: "\(blocktankBaseUrl)/api/notifications"
default: "\(blocktankBaseUrl)/notifications/api"
}
}

static var blocktankClientServer: String {
switch network {
case .bitcoin: "\(blocktankBaseUrl)"
case .bitcoin: "\(blocktankBaseUrl)/api"
default: "\(blocktankBaseUrl)/blocktank/api/v2"
}
}
Expand Down
2 changes: 1 addition & 1 deletion 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 @@ -109,7 +109,7 @@

func isActivitySeen(id: String) async -> Bool {
do {
if let activity = try await getActivityById(activityId: id) {

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

View workflow job for this annotation

GitHub Actions / Run Tests

no 'async' operations occur within 'await' expression
switch activity {
case let .onchain(onchain):
return onchain.seenAt != nil
Expand Down Expand Up @@ -625,7 +625,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 628 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 628 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 @@ -678,7 +678,7 @@

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

Check warning on line 681 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 @@ -714,7 +714,7 @@
latestCaughtError = error
}
}
} catch {

Check warning on line 717 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 @@ -748,7 +748,7 @@
/// Check if a transaction spends a closed channel's funding UTXO
private func findClosedChannelForTransaction(txid: String, transactionDetails: BitkitCore.TransactionDetails? = nil) async -> String? {
do {
let closedChannels = try await getAllClosedChannels(sortDirection: .desc)

Check warning on line 751 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 }

let details = if let provided = transactionDetails { provided } else { await fetchTransactionDetails(txid: txid) }
Expand Down Expand Up @@ -1774,7 +1774,7 @@
} completion: { result in
switch result {
case .success():
Logger.info("Blocktank URL updated to \(Env.blocktankBaseUrl)", context: "CoreService")
Logger.info("Blocktank URL updated to \(Env.blocktankClientServer)", context: "CoreService")
case let .failure(error):
Logger.error("Failed to update Blocktank URL: \(error)", context: "CoreService")
}
Expand Down
2 changes: 1 addition & 1 deletion Bitkit/Views/Settings/BlocktankRegtestView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct BlocktankRegtestView: View {

var serverInfoSection: some View {
Section {
Text(Env.blocktankBaseUrl)
Text(Env.blocktankClientServer)
} footer: {
Text("These actions are executed on the staging Blocktank server node.")
}
Expand Down
Loading