Beispiel #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();
        }
Beispiel #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();
        }
Beispiel #3
0
		public void SetCoins(uint256 txId, Coins coins)
		{
			Index.PutAsync(txId.ToString(), coins);
		}
Beispiel #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();
		}
Beispiel #5
0
        public TxOut GetOutputFor(TxIn input)
        {
            Coins coins = GetCoins(input.PrevOut.Hash);

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