Skip to content

Commit

Permalink
feat(FileSystemApi): advertise root node immediately #111
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider committed Jun 11, 2019
1 parent c25dfd3 commit 1dd2793
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/CoreApi/FileSystemApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,20 @@ public async Task<IFileSystemNode> AddAsync(
{
var link = node.ToLink(name);
var wlinks = new IFileSystemLink[] { link };
return await CreateDirectoryAsync(wlinks, options, cancel).ConfigureAwait(false);
node = await CreateDirectoryAsync(wlinks, options, cancel).ConfigureAwait(false);
}
else
{
node.Name = name;
}

// Advertise the root node.
if (options.Pin && ipfs.IsStarted)
{
await ipfs.Dht.ProvideAsync(node.Id, advertise: true, cancel: cancel).ConfigureAwait(false);
}

// Return the file system node.
node.Name = name;
return node;
}

Expand Down
2 changes: 1 addition & 1 deletion src/IpfsEngine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<PackageReference Include="Makaretu.Dns.Unicast" Version="0.10.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Nito.AsyncEx.Coordination" Version="5.0.0" />
<PackageReference Include="PeerTalk" Version="0.12.0" />
<PackageReference Include="PeerTalk" Version="0.13.0" />
<PackageReference Include="PeterO.Cbor" Version="3.1.0" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.5" />
<PackageReference Include="protobuf-net" Version="2.4.0" />
Expand Down

0 comments on commit 1dd2793

Please sign in to comment.