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); }
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; }