diff options
| author | Gavin Andresen <[email protected]> | 2013-11-10 18:09:58 -0800 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2013-11-10 18:09:58 -0800 |
| commit | 7d7df381f85112f5d00dc8f164451dea5baa48bb (patch) | |
| tree | 624d282fc308688102fa17c1fd331e99e9ac0720 /src/core.cpp | |
| parent | Merge pull request #3185 from gavinandresen/reject (diff) | |
| parent | Move CCoins-related logic to coins.{cpp.h} (diff) | |
| download | discoin-7d7df381f85112f5d00dc8f164451dea5baa48bb.tar.xz discoin-7d7df381f85112f5d00dc8f164451dea5baa48bb.zip | |
Merge pull request #3199 from sipa/mempoolmove
Cleanup refactoring of coins/mempool
Diffstat (limited to 'src/core.cpp')
| -rw-r--r-- | src/core.cpp | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/core.cpp b/src/core.cpp index 26c2cfc5c..80cdcb084 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -183,49 +183,6 @@ uint64_t CTxOutCompressor::DecompressAmount(uint64_t x) return n; } -// calculate number of bytes for the bitmask, and its number of non-zero bytes -// each bit in the bitmask represents the availability of one output, but the -// availabilities of the first two outputs are encoded separately -void CCoins::CalcMaskSize(unsigned int &nBytes, unsigned int &nNonzeroBytes) const { - unsigned int nLastUsedByte = 0; - for (unsigned int b = 0; 2+b*8 < vout.size(); b++) { - bool fZero = true; - for (unsigned int i = 0; i < 8 && 2+b*8+i < vout.size(); i++) { - if (!vout[2+b*8+i].IsNull()) { - fZero = false; - continue; - } - } - if (!fZero) { - nLastUsedByte = b + 1; - nNonzeroBytes++; - } - } - nBytes += nLastUsedByte; -} - -bool CCoins::Spend(const COutPoint &out, CTxInUndo &undo) { - if (out.n >= vout.size()) - return false; - if (vout[out.n].IsNull()) - return false; - undo = CTxInUndo(vout[out.n]); - vout[out.n].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); -} - uint256 CBlockHeader::GetHash() const { return Hash(BEGIN(nVersion), END(nNonce)); |