Beispiel #1
0
        private void loadTransactions(CryptoNote.ISerializer serializer)
        {
            ulong count = 0;

            serializer.functorMethod(count, "transactionCount");

            m_transactions.get <RandomAccessIndex>().reserve(count);

            for (ulong i = 0; i < count; ++i)
            {
                WalletTransactionDtoV2 dto = new WalletTransactionDtoV2();
                serializer.functorMethod(dto, "transaction");

                WalletTransaction tx = new WalletTransaction();
                tx.state        = dto.state;
                tx.timestamp    = dto.timestamp;
                tx.blockHeight  = dto.blockHeight;
                tx.hash         = dto.hash;
                tx.totalAmount  = dto.totalAmount;
                tx.fee          = dto.fee;
                tx.creationTime = dto.creationTime;
                tx.unlockTime   = dto.unlockTime;
                tx.extra        = dto.extra;
                tx.isBase       = dto.isBase;

                m_transactions.get <RandomAccessIndex>().push_back(std::move(tx));
            }
        }
Beispiel #2
0
        private void saveTransactions(CryptoNote.ISerializer serializer)
        {
            ulong count = m_transactions.size();

            serializer.functorMethod(count, "transactionCount");

            foreach (var tx in m_transactions)
            {
                WalletTransactionDtoV2 dto = new WalletTransactionDtoV2(tx);
                serializer.functorMethod(dto, "transaction");
            }
        }