Skip to content

Commit

Permalink
Suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
greymistcube committed May 30, 2022
1 parent 71cabcf commit 7e5fe07
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Libplanet.Explorer.Executable/Program.cs
Expand Up @@ -230,6 +230,10 @@ public static async Task Main(string[] args)
// FIXME: The appProtocolVersion should be fixed properly.
var swarmOptions = new SwarmOptions
{
BootstrapOptions = new BootstrapOptions
{
SeedPeers = options.Seeds.ToImmutableList(),
},
TimeoutOptions = new TimeoutOptions
{
MaxTimeout = TimeSpan.FromSeconds(10),
Expand Down Expand Up @@ -262,7 +266,7 @@ public static async Task Main(string[] args)
{
await Task.WhenAll(
webHost.RunAsync(cts.Token),
StartSwarmAsync(swarm, options.Seeds, cts.Token)
StartSwarmAsync(swarm, cts.Token)
);
}
catch (OperationCanceledException)
Expand Down Expand Up @@ -356,7 +360,6 @@ private static BlockPolicy<T> LoadBlockPolicy<T>(Options options)

private static async Task StartSwarmAsync(
Swarm<NullAction> swarm,
IEnumerable<Peer> seeds,
CancellationToken cancellationToken)
{
if (swarm is null)
Expand All @@ -368,12 +371,7 @@ private static BlockPolicy<T> LoadBlockPolicy<T>(Options options)
try
{
Console.Error.WriteLine("Bootstrapping.");
await swarm.BootstrapAsync(
seeds,
TimeSpan.FromMilliseconds(5000),
Kademlia.MaxDepth,
cancellationToken: cancellationToken
);
await swarm.BootstrapAsync(cancellationToken);
}
catch (TimeoutException)
{
Expand Down

0 comments on commit 7e5fe07

Please sign in to comment.