Changeset View
Changeset View
Standalone View
Standalone View
src/test/coins_tests.cpp
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) override { | ||||
hashBestBlock_ = hashBlock; | hashBestBlock_ = hashBlock; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
}; | }; | ||||
class CCoinsViewCacheTest : public CCoinsViewCache { | class CCoinsViewCacheTest : public CCoinsViewCache { | ||||
public: | public: | ||||
CCoinsViewCacheTest(CCoinsView *_base) : CCoinsViewCache(_base) {} | explicit CCoinsViewCacheTest(CCoinsView *_base) : CCoinsViewCache(_base) {} | ||||
void SelfTest() const { | void SelfTest() const { | ||||
// Manually recompute the dynamic usage of the whole data, and compare | // Manually recompute the dynamic usage of the whole data, and compare | ||||
// it. | // it. | ||||
size_t ret = memusage::DynamicUsage(cacheCoins); | size_t ret = memusage::DynamicUsage(cacheCoins); | ||||
size_t count = 0; | size_t count = 0; | ||||
for (CCoinsMap::iterator it = cacheCoins.begin(); | for (CCoinsMap::iterator it = cacheCoins.begin(); | ||||
it != cacheCoins.end(); it++) { | it != cacheCoins.end(); it++) { | ||||
▲ Show 20 Lines • Show All 810 Lines • Show Last 20 Lines |