diff options
author | jtimon <jtimon@blockstream.io> | 2014-10-19 02:57:02 +0200 |
---|---|---|
committer | jtimon <jtimon@jtimon.cc> | 2014-12-27 15:46:09 +0100 |
commit | c444c620c62c51d65f7de0b2a3c351e61ab1e388 (patch) | |
tree | df3a6a164ba30069fcf9dd2a646cb593f90dad51 /src/coins.cpp | |
parent | 0f2308cf7cfffe13b0206802622cad4d9e009aa1 (diff) |
Decouple CCoins from CTxInUndo
Diffstat (limited to 'src/coins.cpp')
-rw-r--r-- | src/coins.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/coins.cpp b/src/coins.cpp index bc430c9c7e..f4599ff39d 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -31,29 +31,15 @@ void CCoins::CalcMaskSize(unsigned int &nBytes, unsigned int &nNonzeroBytes) con nBytes += nLastUsedByte; } -bool CCoins::Spend(const COutPoint &out, CTxInUndo &undo) { - if (out.n >= vout.size()) - return false; - if (vout[out.n].IsNull()) +bool CCoins::Spend(uint32_t nPos) +{ + if (nPos >= vout.size() || vout[nPos].IsNull()) return false; - undo = CTxInUndo(vout[out.n]); - vout[out.n].SetNull(); + vout[nPos].SetNull(); Cleanup(); - if (vout.size() == 0) { - undo.nHeight = nHeight; - undo.fCoinBase = fCoinBase; - undo.nVersion = this->nVersion; - } return true; } -bool CCoins::Spend(int nPos) { - CTxInUndo undo; - COutPoint out(0, nPos); - return Spend(out, undo); -} - - bool CCoinsView::GetCoins(const uint256 &txid, CCoins &coins) const { return false; } bool CCoinsView::HaveCoins(const uint256 &txid) const { return false; } uint256 CCoinsView::GetBestBlock() const { return uint256(0); } |