aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/main.h b/src/main.h
index d717802618..b8db357aed 100644
--- a/src/main.h
+++ b/src/main.h
@@ -1062,14 +1062,14 @@ public:
// This may (but cannot always) return true for fully spent transactions
virtual bool HaveCoins(const uint256 &txid);
- // Retrieve the block index whose state this CCoinsView currently represents
- virtual CBlockIndex *GetBestBlock();
+ // Retrieve the block hash whose state this CCoinsView currently represents
+ virtual uint256 GetBestBlock();
- // Modify the currently active block index
- virtual bool SetBestBlock(CBlockIndex *pindex);
+ // Modify the currently active block hash
+ virtual bool SetBestBlock(const uint256 &hashBlock);
// Do a bulk modification (multiple SetCoins + one SetBestBlock)
- virtual bool BatchWrite(const std::map<uint256, CCoins> &mapCoins, CBlockIndex *pindex);
+ virtual bool BatchWrite(const std::map<uint256, CCoins> &mapCoins, const uint256 &hashBlock);
// Calculate statistics about the unspent transaction output set
virtual bool GetStats(CCoinsStats &stats);
@@ -1089,10 +1089,10 @@ public:
bool GetCoins(const uint256 &txid, CCoins &coins);
bool SetCoins(const uint256 &txid, const CCoins &coins);
bool HaveCoins(const uint256 &txid);
- CBlockIndex *GetBestBlock();
- bool SetBestBlock(CBlockIndex *pindex);
+ uint256 GetBestBlock();
+ bool SetBestBlock(const uint256 &hashBlock);
void SetBackend(CCoinsView &viewIn);
- bool BatchWrite(const std::map<uint256, CCoins> &mapCoins, CBlockIndex *pindex);
+ bool BatchWrite(const std::map<uint256, CCoins> &mapCoins, const uint256 &hashBlock);
bool GetStats(CCoinsStats &stats);
};
@@ -1100,7 +1100,7 @@ public:
class CCoinsViewCache : public CCoinsViewBacked
{
protected:
- CBlockIndex *pindexTip;
+ uint256 hashBlock;
std::map<uint256,CCoins> cacheCoins;
public:
@@ -1110,9 +1110,9 @@ public:
bool GetCoins(const uint256 &txid, CCoins &coins);
bool SetCoins(const uint256 &txid, const CCoins &coins);
bool HaveCoins(const uint256 &txid);
- CBlockIndex *GetBestBlock();
- bool SetBestBlock(CBlockIndex *pindex);
- bool BatchWrite(const std::map<uint256, CCoins> &mapCoins, CBlockIndex *pindex);
+ uint256 GetBestBlock();
+ bool SetBestBlock(const uint256 &hashBlock);
+ bool BatchWrite(const std::map<uint256, CCoins> &mapCoins, const uint256 &hashBlock);
// Return a modifiable reference to a CCoins. Check HaveCoins first.
// Many methods explicitly require a CCoinsViewCache because of this method, to reduce