Exemplo n.º 1
0
        private void ResolveConflict(string localFilename, string filename)
        {
            IpfsFile file = _Files.First(o => o.LocalFilename == localFilename);

            if (file.ComputeHash(filename) != file.Hash)
            {
                Dirty = true;
                //TODO: Complete
            }
        }
Exemplo n.º 2
0
        private void ResolveConflict(IpfsFile remoteFile)
        {
            IpfsFile file = _Files.First(o => o.LocalFilename == remoteFile.LocalFilename);

            if (file.Hash != remoteFile.Hash)
            {
                Dirty = true;
                //TODO: Complete
            }
        }
Exemplo n.º 3
0
        private async Task AddFileNotAlreadyExisting(string filename, object lockObject)
        {
            string hashFilename = await IpfsApiWrapper.AddAsync(filename);

            IpfsFile file = new IpfsFile
            {
                LocalFilename  = filename,
                RemoteFilename = hashFilename
            };

            file.ComputerAndStoreHash(filename);
            lock (lockObject)
            {
                Dirty = true;
                _Files.Add(file);
            }
        }