Пример #1
0
        private void Delete(byte[] key, bool tryCommit = true)
        {
            batch.Delete(key);
            var keyHash = key.Keccak();

            _memDb[keyHash] = null;
            DbShrinkUtils.UpdateCounter();
            if (tryCommit && DbShrinkUtils.CycleEnded())
            {
                Commit();
            }
        }
Пример #2
0
        private void Save(byte[] key, byte[] content, bool tryCommit = true)
        {
            batch.Put(key, content);
            var keyHash = key.Keccak();

            _memDb[keyHash] = content;
            DbShrinkUtils.UpdateCounter();
            if (tryCommit && DbShrinkUtils.CycleEnded())
            {
                Commit();
            }
        }