public void Commit() { foreach (var item in cache) { switch (item.Value.State) { case TrackState.Added: case TrackState.Changed: store.Put(Key(item.Key), item.Value.Node.ToArray()); break; case TrackState.Deleted: store.Delete(Key(item.Key)); break; } } cache.Clear(); }
protected override void AddInternal(StorageKey key, StorageItem value) { snapshot?.Put(key.ToArray(), value.ToArray()); }
protected override void AddInternal(TKey key, TValue value) { snapshot?.Put(prefix, key.ToArray(), value.ToArray()); }
public void AddLocalStateRoot(StateRoot state_root) { snapshot.Put(Keys.StateRoot(state_root.Index), state_root.ToArray()); snapshot.Put(Keys.CurrentLocalRootIndex, BitConverter.GetBytes(state_root.Index)); }
private void PutToStore(MPTNode node) { store.Put(Prefix, node.Hash.ToArray(), node.Encode()); }
protected override void AddInternal(T item) { snapshot?.Put(prefix, null, item.ToArray()); }