Пример #1
0
        private void Received(TrackedScript match, IndexedTxOut txout, ChainedBlock block, MerkleBlock proof)
        {
            var operation = new Operation(txout.Transaction, block, proof);

            SetUnconfirmedSeenIfPossible(txout.Transaction, block, operation);
            var coin = new Coin(txout);

            operation.ReceivedCoins.Add(Tuple.Create(coin, match.GetId()));
            _Operations.AddOrUpdate(operation.GetId(), operation, (k, old) => old.Merge(operation));
            var trackedOutpoint = new TrackedOutpoint()
            {
                Coin            = coin,
                TrackedScriptId = match.GetId(),
                Filter          = match.Filter
            };

            _TrackedOutpoints.TryAdd(trackedOutpoint.GetId(), trackedOutpoint);
        }
Пример #2
0
        private Operation Received(TrackedScript match, IndexedTxOut txout, ChainedBlock block, MerkleBlock proof)
        {
            var operation = new Operation(txout.Transaction, block, proof, _TrackedScripts);

            SetUnconfirmedSeenIfPossible(txout.Transaction, block, operation);
            var coin = new Coin(txout);

            operation.ReceivedCoins.Add(Tuple.Create(coin, match.GetId()));

            bool merged          = false;
            var  returned        = _Operations.AddOrUpdate(operation.GetId(), operation, (k, old) => old.Merge(operation, out merged));
            var  trackedOutpoint = new TrackedOutpoint()
            {
                Coin            = coin,
                TrackedScriptId = match.GetId(),
                Filter          = match.Filter
            };

            _TrackedOutpoints.TryAdd(trackedOutpoint.GetId(), trackedOutpoint);
            return((operation == returned || merged) ? operation : null);
        }
Пример #3
0
 public Task <TrustedInput> GetTrustedInputAsync(IndexedTxOut txout, CancellationToken cancellation = default(CancellationToken))
 {
     return(GetTrustedInputAsync(txout.Transaction, (int)txout.N, cancellation));
 }
Пример #4
0
 public TrustedInput GetTrustedInput(IndexedTxOut txout, CancellationToken cancellation = default(CancellationToken))
 {
     return(GetTrustedInputAsync(txout.Transaction, (int)txout.N, cancellation).GetAwaiter().GetResult());
 }
Пример #5
0
 public TrustedInput GetTrustedInput(IndexedTxOut txout)
 {
     return GetTrustedInput(txout.Transaction, (int)txout.N);
 }
Пример #6
0
		public ScriptCoin(IndexedTxOut txOut, Script redeem)
			: base(txOut)
		{
			Redeem = redeem;
			AssertCoherent();
		}
Пример #7
0
		public Coin(IndexedTxOut txOut)
		{
			Outpoint = new OutPoint(txOut.Transaction.GetHash(), txOut.N);
			TxOut = txOut.TxOut;
		}
Пример #8
0
 public TrustedInput GetTrustedInput(IndexedTxOut txout)
 {
     return(GetTrustedInputAsync(txout.Transaction, (int)txout.N).GetAwaiter().GetResult());
 }
Пример #9
0
 public Task <TrustedInput> GetTrustedInputAsync(IndexedTxOut txout)
 {
     return(GetTrustedInputAsync(txout.Transaction, (int)txout.N));
 }
Пример #10
0
		private void Received(TrackedScript match, IndexedTxOut txout, ChainedBlock block, MerkleBlock proof)
		{
			var operation = new Operation(txout.Transaction, block, proof);
			SetUnconfirmedSeenIfPossible(txout.Transaction, block, operation);
			var coin = new Coin(txout);
			operation.ReceivedCoins.Add(Tuple.Create(coin, match.GetId()));
			_Operations.AddOrUpdate(operation.GetId(), operation, (k, old) => old.Merge(operation));
			var trackedOutpoint = new TrackedOutpoint()
			{
				Coin = coin,
				TrackedScriptId = match.GetId(),
				Filter = match.Filter
			};
			_TrackedOutpoints.TryAdd(trackedOutpoint.GetId(), trackedOutpoint);
		}
Пример #11
0
 public ScriptCoin(IndexedTxOut txOut, Script redeem)
     : base(txOut)
 {
     Redeem = redeem;
     AssertCoherent();
 }
Пример #12
0
 public Coin(IndexedTxOut txOut)
 {
     Outpoint = new OutPoint(txOut.Transaction.GetHash(), txOut.N);
     TxOut    = txOut.TxOut;
 }
Пример #13
0
		private Operation Received(TrackedScript match, IndexedTxOut txout, ChainedBlock block, MerkleBlock proof)
		{
			var operation = new Operation(txout.Transaction, block, proof, _TrackedScripts);
			SetUnconfirmedSeenIfPossible(txout.Transaction, block, operation);
			var coin = new Coin(txout);
			operation.ReceivedCoins.Add(Tuple.Create(coin, match.GetId()));

			bool merged = false;
			var returned = _Operations.AddOrUpdate(operation.GetId(), operation, (k, old) => old.Merge(operation, out merged));
			var trackedOutpoint = new TrackedOutpoint()
			{
				Coin = coin,
				TrackedScriptId = match.GetId(),
				Filter = match.Filter
			};
			_TrackedOutpoints.TryAdd(trackedOutpoint.GetId(), trackedOutpoint);
			return (operation == returned || merged) ? operation : null;
		}
Пример #14
0
		public WitScriptCoin(IndexedTxOut txOut, Script witRedeem)
			: base(txOut)
		{
			SetAll(txOut.TxOut.ScriptPubKey, witRedeem);
		}