Preliminary undo file creation

Create files (one per block) with undo information for the transactions
in it.
This commit is contained in:
Pieter Wuille
2012-06-23 14:17:13 +02:00
parent 630fd8dcb6
commit 8adf48dc9b
2 changed files with 32 additions and 0 deletions

View File

@@ -155,6 +155,10 @@ public:
return GetDirectory(base) / strprintf("%08u%s.blk", nHeight, GetAlternative().c_str());
}
boost::filesystem::path GetUndoFile(const boost::filesystem::path &base) const {
return GetDirectory(base) / strprintf("%08u%s.und", nHeight, GetAlternative().c_str());
}
// TODO: make thread-safe (lockfile, atomic file creation, ...?)
void MakeUnique(const boost::filesystem::path &base) {
while (boost::filesystem::exists(GetFileName(base)))
@@ -810,6 +814,17 @@ public:
)
};
/** Undo information for a CBlock */
class CBlockUndo
{
public:
std::vector<CTxUndo> vtxundo;
IMPLEMENT_SERIALIZE(
READWRITE(vtxundo);
)
};
/** pruned version of CTransaction: only retains metadata and unspent transaction outputs
*
* Serialized format: