Beispiel #1
0
 public void Add(Envelope tx)
 {
     lock (obj)
     {
         _txList.Add(tx);
     }
     //0是未处理的交易
     //缓存状态 10 分钟过期
     _memoryCache.Set("tx_" + tx.TxReqeust.Data.TxId, "0", new DateTimeOffset(DateTime.Now, TimeSpan.FromMinutes(10)));
     if (_txList.Count() >= _configProvider.GetMaxTxCount())
     {
         Task.Run(() =>
         {
             BlockPacking();
         });
     }
 }