public bool Spend(int position, out TxInUndo undo)
        {
            undo = null;

            if (position >= this.Outputs.Count)
            {
                return(false);
            }

            if (IsNull(this.Outputs[position]))
            {
                return(false);
            }

            undo = new TxInUndo(this.Outputs[position].Clone());
            this.Outputs[position] = NullTxOut;
            Cleanup();

            if (this.IsEmpty)
            {
                undo.Height   = this.nHeight;
                undo.CoinBase = this.CoinBase;
                undo.Version  = this.nVersion;
            }

            return(true);
        }
Example #2
0
 public bool Spend(int position, out TxInUndo undo)
 {
     undo = null;
     if (position >= vout.Count)
     {
         return(false);
     }
     if (vout[position].IsNull)
     {
         return(false);
     }
     undo = new TxInUndo(vout[position].Clone());
     vout[position].SetNull();
     Cleanup();
     if (vout.Count == 0)
     {
         undo.Height   = nHeight;
         undo.CoinBase = fCoinBase;
         undo.Version  = nVersion;
     }
     return(true);
 }
Example #3
0
#pragma warning disable CS0612 // Type or member is obsolete
        public bool Spend(int position, out TxInUndo undo)
        {
            undo = null;
            if (position >= Outputs.Count)
            {
                return(false);
            }
            if (IsNull(Outputs[position]))
            {
                return(false);
            }
            undo = new TxInUndo(Outputs[position].Clone());
#pragma warning restore CS0612 // Type or member is obsolete
            Outputs[position] = NullTxOut;
            Cleanup();
            if (IsEmpty)
            {
                undo.Height   = nHeight;
                undo.CoinBase = CoinBase;
                undo.Version  = nVersion;
            }
            return(true);
        }
Example #4
0
		public bool Spend(int position, out TxInUndo undo)
		{
			undo = null;
			if(position >= vout.Count)
				return false;
			if(vout[position].IsNull)
				return false;
			undo = new TxInUndo(vout[position].Clone());
			vout[position].SetNull();
			Cleanup();
			if(vout.Count == 0)
			{
				undo.Height = nHeight;
				undo.CoinBase = fCoinBase;
				undo.Version = nVersion;
			}
			return true;
		}