Skip to content

Commit 7072c31

Browse files
committed
Fix wait for node block
1 parent 0445771 commit 7072c31

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

app/src/main/java/to/bitkit/repositories/BlocktankRepo.kt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -420,19 +420,17 @@ class BlocktankRepo @Inject constructor(
420420
operationName = "claimGiftCode",
421421
waitTimeout = waitTimeout,
422422
) {
423-
Result.success(Unit)
424-
}.getOrThrow()
425-
426-
delay(PEER_CONNECTION_DELAY_MS)
423+
delay(PEER_CONNECTION_DELAY_MS)
427424

428-
val channels = lightningRepo.getChannelsAsync().getOrThrow()
429-
val maxInboundCapacity = channels.calculateRemoteBalance()
425+
val channels = lightningRepo.getChannelsAsync().getOrThrow()
426+
val maxInboundCapacity = channels.calculateRemoteBalance()
430427

431-
if (maxInboundCapacity >= amount) {
432-
claimGiftCodeWithLiquidity(code)
433-
} else {
434-
claimGiftCodeWithoutLiquidity(code, amount)
435-
}
428+
if (maxInboundCapacity >= amount) {
429+
Result.success(claimGiftCodeWithLiquidity(code))
430+
} else {
431+
Result.success(claimGiftCodeWithoutLiquidity(code, amount))
432+
}
433+
}.getOrThrow()
436434
}.onFailure { e ->
437435
Logger.error("Failed to claim gift code", e, context = TAG)
438436
}

0 commit comments

Comments
 (0)