コード例 #1
0
        private void CreateOrUpdateTransactionViewModel(TransactionRecord aTransactionRecord, uint aCoinID, IEnumerable <string> aAccounts)
        {
            if (!FTransactionsViewModels.ContainsKey(aCoinID))
            {
                FTransactionsViewModels[aCoinID] = new List <TransactionViewModel>();
            }

            if ((!FTransactionsViewModels[aCoinID].Exists(x => x.TransactionID == aTransactionRecord.TxId)))
            {
                FTransactionsViewModels[aCoinID].Add(new TransactionViewModel(aTransactionRecord, aAccounts));
            }

            if (aCoinID != 0)
            {
                TransactionViewModel lTransactionViewModel = FTransactionsViewModels[aCoinID].Find(x => x.TransactionID == aTransactionRecord.TxId);

                if (aTransactionRecord.Block != 0 && lTransactionViewModel.Block == 0)
                {
                    lTransactionViewModel.Set(aTransactionRecord, aAccounts);
                }

                lTransactionViewModel.SetBlockHeight(FWalletPandoraServer.GetBlockHeight(aCoinID), FWalletPandoraServer.GetCurrency(aCoinID).MinConfirmations);

                if (!lTransactionViewModel.isConfirmed)
                {
                    FWalletPandoraServer.CheckIfConfirmed(Convert.ToUInt32(aCoinID), aTransactionRecord.Block);
                }
            }
        }