Ejemplo n.º 1
0
        protected void ReceiveTransactionFromMemoryPool(Transaction transaction)
        {
            var walletTransaction = BlockService.AnalyzeTransaction(transaction, int.MaxValue, this.metadata.Blocks.Values, GetOrAddAddress);

            if (walletTransaction != null)
            {
                var entry = MemoryPoolService.CreateMemoryPoolEntry(walletTransaction, null);
                this.metadata.MemoryPool.Entries.Add(entry);
            }
            SaveMetadata();
        }
Ejemplo n.º 2
0
        protected void TransactionBroadcastEntryChanged(TransactionBroadcastEntry broadcastEntry)
        {
            var memoryPoolEntry = MemoryPoolService.GetMemoryPoolEntry(broadcastEntry.Transaction.GetHash(), this.metadata.MemoryPool.Entries);

            if (memoryPoolEntry == null)
            {
                TransactionMetadata walletTransaction = BlockService.AnalyzeTransaction(broadcastEntry.Transaction, int.MaxValue, this.metadata.Blocks.Values, GetOrAddAddress);
                if (walletTransaction != null)
                {
                    var entry = MemoryPoolService.CreateMemoryPoolEntry(walletTransaction, broadcastEntry);
                    this.metadata.MemoryPool.Entries.Add(entry);
                }
            }
            else
            {
                MemoryPoolService.UpdateMemoryPoolEntry(memoryPoolEntry, broadcastEntry);
            }
            SaveMetadata();
        }