aboutsummaryrefslogtreecommitdiff
path: root/src/core.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2013-11-05 02:47:07 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2013-11-10 19:37:56 +0100
commita0fa20a12b69717636050dd8742713b1d82ae524 (patch)
treed1db4dc173a9f4d24904a1636f5cf82cd3c1c737 /src/core.cpp
parent84674082b0c4cfcdd54fb97a29bc841aa7f691c2 (diff)
Move CCoins-related logic to coins.{cpp.h}
Diffstat (limited to 'src/core.cpp')
-rw-r--r--src/core.cpp43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/core.cpp b/src/core.cpp
index 26c2cfc5c5..80cdcb0849 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));