public BroadcastHubBehavior(BroadcastHub hub)
 {
     _BroadcastHub = hub ?? new BroadcastHub();
     foreach (var tx in _BroadcastHub.BroadcastedTransaction)
     {
         _HashToTransaction.TryAdd(tx.Key, new TransactionBroadcast()
         {
             State       = BroadcastState.NotSent,
             Transaction = tx.Value
         });
     }
 }
 public BroadcastHubBehavior(BroadcastHub hub)
 {
     this.BroadcastHub = hub ?? new BroadcastHub();
     foreach (KeyValuePair <uint256, Transaction> tx in this.BroadcastHub.BroadcastedTransaction)
     {
         this.hashToTransaction.TryAdd(tx.Key, new TransactionBroadcast()
         {
             State       = BroadcastState.NotSent,
             Transaction = tx.Value
         });
     }
 }
 public BroadcastHubBehavior()
 {
     _BroadcastHub = new BroadcastHub();
 }
Ejemplo n.º 4
0
 public SPVBehavior(/*Action<Types.Transaction> newTransactionHandler*/ BlockChain.BlockChain blockChain, BroadcastHub broadcastHub)
 {
     //this._NewTransactionHandler = newTransactionHandler;
     _BlockChain   = blockChain;
     _BroadcastHub = broadcastHub;
 }
Ejemplo n.º 5
0
			protected override void AttachCore()
			{
				_Tracker = AttachedNode.Behaviors.Find<TrackerBehavior>();
				if(_Tracker != null)
				{
					AttachedNode.Disconnected += AttachedNode_Disconnected;
					AttachedNode.StateChanged += AttachedNode_StateChanged;
				}
				_Broadcast = BroadcastHub.GetBroadcastHub(AttachedNode);
				if(_Broadcast != null)
				{
					_Broadcast.TransactionBroadcasted += _Broadcast_TransactionBroadcasted;
					_Broadcast.TransactionRejected += _Broadcast_TransactionRejected;
				}
			}
		public BroadcastHubBehavior(BroadcastHub hub)
		{
			_BroadcastHub = hub ?? new BroadcastHub();
			foreach(var tx in _BroadcastHub.BroadcastedTransaction)
			{
				_HashToTransaction.TryAdd(tx.Key, new TransactionBroadcast()
				{
					State = BroadcastState.NotSent,
					Transaction = tx.Value
				});
			}
		}
		public BroadcastHubBehavior()
		{
			_BroadcastHub = new BroadcastHub();
		}
 public BroadcastHubBehavior()
 {
     this.hashToTransaction = new ConcurrentDictionary <uint256, TransactionBroadcast>();
     this.pingToTransaction = new ConcurrentDictionary <ulong, TransactionBroadcast>();
     this.BroadcastHub      = new BroadcastHub();
 }