Example #1
0
        public void MergeFrom(Coins otherCoin)
        {
            var diff = otherCoin.Outputs.Count - this.Outputs.Count;

            if (diff > 0)
            {
                for (int i = 0; i < diff; i++)
                {
                    Outputs.Add(NullTxOut);
                }
            }
            for (int i = 0; i < otherCoin.Outputs.Count; i++)
            {
                Outputs[i] = otherCoin.Outputs[i];
            }
            UpdateValue();
        }
Example #2
0
        public void MergeFrom(Coins otherCoin)
        {
            var diff = otherCoin.Outputs.Count - this.Outputs.Count;

            if (diff > 0)
            {
                Outputs.Resize(otherCoin.Outputs.Count);
                for (int i = 0; i < Outputs.Count; i++)
                {
                    if (Outputs[i] == null)
                    {
                        Outputs[i] = new TxOut();
                    }
                }
            }
            for (int i = 0; i < otherCoin.Outputs.Count; i++)
            {
                if (!otherCoin.Outputs[i].IsNull)
                {
                    Outputs[i] = otherCoin.Outputs[i];
                }
            }
            UpdateValue();
        }
Example #3
0
		public void SetCoins(uint256 txId, Coins coins)
		{
			Index.PutAsync(txId.ToString(), coins);
		}
Example #4
0
		public void MergeFrom(Coins otherCoin)
		{
			var diff = otherCoin.Outputs.Count - this.Outputs.Count;
			if(diff > 0)
			{
				Outputs.Resize(otherCoin.Outputs.Count);
				for(int i = 0 ; i < Outputs.Count ; i++)
				{
					if(Outputs[i] == null)
						Outputs[i] = new TxOut();
				}
			}
			for(int i = 0 ; i < otherCoin.Outputs.Count ; i++)
			{
				if(!otherCoin.Outputs[i].IsNull)
					Outputs[i] = otherCoin.Outputs[i];
			}
			UpdateValue();
		}
Example #5
0
        public TxOut GetOutputFor(TxIn input)
        {
            Coins coins = GetCoins(input.PrevOut.Hash);

            return(coins.TryGetOutput(input.PrevOut.N));
        }
Example #6
0
 public void SetCoins(uint256 txId, Coins coins)
 {
     Index.PutAsync(txId.ToString(), coins);
 }
Example #7
0
 public void SetCoins(uint256 txId, Coins coins)
 {
     this.NoSqlRepository.PutAsync(txId.ToString(), coins);
 }