private void Announce(TransactionBroadcast tx, uint256 hash) { var node = AttachedNode; if (node != null && node.State == NodeState.HandShaked) { tx.State = BroadcastState.Announced; tx.AnnouncedTime = DateTime.UtcNow; node.SendMessageAsync(new InvPayload(InventoryType.MSG_TX, hash)).ConfigureAwait(false); } }
internal void BroadcastTransactionCore(Transaction transaction) { if (transaction == null) { throw new ArgumentNullException("transaction"); } var tx = new TransactionBroadcast(); tx.Transaction = transaction; tx.State = BroadcastState.NotSent; var hash = transaction.GetHash(); if (_HashToTransaction.TryAdd(hash, tx)) { Announce(tx, hash); } }