Пример #1
0
 /// <inheritdoc cref="IStore"/>
 public void PutBlock <T>(Block <T> block)
     where T : IAction, new()
 {
     _store.PutBlock(block);
     foreach (var tx in block.Transactions)
     {
         PutTransaction(tx);
         StoreTxReferences(tx.Id, block.Hash, tx.Nonce);
     }
 }
Пример #2
0
        /// <inheritdoc cref="IStore"/>
        public void PutBlock <T>(Block <T> block)
            where T : IAction, new()
        {
            if (_blockCache.ContainsKey(block.Hash))
            {
                return;
            }

            _store.PutBlock(block);
            foreach (var tx in block.Transactions)
            {
                PutTransaction(tx);
                StoreTxReferences(tx.Id, block.Hash, block.Index);
            }

            _blockCache.AddOrUpdate(block.Hash, block.ToBlockDigest());
        }