internal void Announce(TransactionBroadcast tx, uint256 hash, bool force = false) { if (!force && BroadcastHub.ManualBroadcast) { return; } 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(nameof(transaction)); } var tx = new TransactionBroadcast(); tx.Transaction = transaction; tx.State = BroadcastState.NotSent; var hash = transaction.GetHash(); if (_hashToTransaction.TryAdd(hash, tx)) { Announce(tx, hash); } }