Exemplo n.º 1
0
        public void PutNode(MPTNode np)
        {
            var n = Resolve(np.Hash);

            if (n is null)
            {
                np.Reference = 1;
                cache.Add(np.Hash, np.Clone());
                return;
            }
            cache.GetAndChange(np.Hash).Reference++;
        }
Exemplo n.º 2
0
        public void PutNode(MPTNode np)
        {
            var n = Resolve(np.Hash);

            if (n is null)
            {
                np.Reference   = 1;
                cache[np.Hash] = new Trackable
                {
                    Node  = np.Clone(),
                    State = TrackState.Added,
                };
                return;
            }
            var entry = cache[np.Hash];

            entry.Node.Reference++;
            entry.State = TrackState.Changed;
        }