Add mapAnchors infrastructure to CCoinsView.

This adds the TXDB/CCoinsViewCache primitives necessary for
writing consensus rules for mapAnchors later.
This commit is contained in:
Sean Bowe
2016-01-04 02:54:47 -07:00
parent 96c31d163f
commit 9f25631d50
6 changed files with 404 additions and 13 deletions

View File

@@ -14,6 +14,8 @@
#include <utility>
#include <vector>
#include "libzerocash/IncrementalMerkleTree.h"
class CBlockFileInfo;
class CBlockIndex;
struct CDiskTxPos;
@@ -34,10 +36,15 @@ protected:
public:
CCoinsViewDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false);
bool GetAnchorAt(const uint256 &rt, libzerocash::IncrementalMerkleTree &tree) const;
bool GetCoins(const uint256 &txid, CCoins &coins) const;
bool HaveCoins(const uint256 &txid) const;
uint256 GetBestBlock() const;
bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock);
uint256 GetBestAnchor() const;
bool BatchWrite(CCoinsMap &mapCoins,
const uint256 &hashBlock,
const uint256 &hashAnchor,
CAnchorsMap &mapAnchors);
bool GetStats(CCoinsStats &stats) const;
};