Skip to content

Commit

Permalink
add check for non-empty LiteServersDesc
Browse files Browse the repository at this point in the history
  • Loading branch information
andreypfau committed Dec 23, 2022
1 parent 6d960b9 commit ddcf046
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ public class LiteClient(
coroutineContext: CoroutineContext,
private val liteClientConfigGlobal: LiteClientConfigGlobal
) : Closeable, CoroutineScope {
public constructor(
coroutineContext: CoroutineContext,
liteServers: List<LiteServerDesc>
) : this(coroutineContext, LiteClientConfigGlobal(liteServers = liteServers))

public constructor(
coroutineContext: CoroutineContext,
vararg liteServer: LiteServerDesc
) : this(coroutineContext, liteServer.toList())

init {
require(liteClientConfigGlobal.liteServers.isNotEmpty()) { "No lite servers provided" }
}

private val logger: Logger = PrintLnLogger("LiteClient")
override val coroutineContext: CoroutineContext = coroutineContext + CoroutineName("LiteClient")
private val knownBlockIds: ArrayDeque<TonNodeBlockIdExt> = ArrayDeque(100)
Expand Down

0 comments on commit ddcf046

Please sign in to comment.