public IEnumerable <SmartTransaction> ReleaseToMempoolFromBlock(uint256 blockHash)
 {
     lock (Lock)
     {
         List <SmartTransaction> reorgedTxs = new();
         foreach (var txHash in ConfirmedStore
                  .GetTransactions()
                  .Where(tx => tx.BlockHash == blockHash)
                  .Select(tx => tx.GetHash()))
         {
             if (ConfirmedStore.TryRemove(txHash, out var removedTx))
             {
                 removedTx.SetUnconfirmed();
                 if (MempoolStore.TryAddOrUpdate(removedTx).isAdded)
                 {
                     reorgedTxs.Add(removedTx);
                 }
             }
         }
         return(reorgedTxs);
     }
 }
    private void AddOrUpdateNoLock(SmartTransaction tx)
    {
        var hash = tx.GetHash();

        if (tx.Confirmed)
        {
            if (MempoolStore.TryRemove(hash, out var found))
            {
                found.TryUpdate(tx);
                ConfirmedStore.TryAddOrUpdate(found);
            }
            else
            {
                ConfirmedStore.TryAddOrUpdate(tx);
            }
        }
        else
        {
            if (!ConfirmedStore.TryUpdate(tx))
            {
                MempoolStore.TryAddOrUpdate(tx);
            }
        }
    }