Preliminary undo file creation
Create files (one per block) with undo information for the transactions in it.
This commit is contained in:
15
src/main.h
15
src/main.h
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user