Example #1
0
 public void Map(long deltaNumber, Cid deltaHash)
 {
     if (!_repository.TryGet(DeltaIndexDao.BuildDocumentId((ulong)deltaNumber), out _))
     {
         _repository.Add(new DeltaIndexDao {
             Height = (ulong)deltaNumber, Cid = deltaHash
         });
     }
 }
Example #2
0
        public bool TryFind(long deltaNumber, out Cid deltaHash)
        {
            if (_repository.TryGet(DeltaIndexDao.BuildDocumentId((ulong)deltaNumber), out var delta))
            {
                deltaHash = delta.Cid;
                return(true);
            }

            deltaHash = default;
            return(false);
        }