Changeset View
Changeset View
Standalone View
Standalone View
src/txdb.cpp
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | template <typename Stream> void Unserialize(Stream &s) { | ||||
s >> id; | s >> id; | ||||
uint32_t n = 0; | uint32_t n = 0; | ||||
s >> VARINT(n); | s >> VARINT(n); | ||||
*outpoint = COutPoint(id, n); | *outpoint = COutPoint(id, n); | ||||
} | } | ||||
}; | }; | ||||
} // namespace | } // namespace | ||||
CCoinsViewDB::CCoinsViewDB(size_t nCacheSize, bool fMemory, bool fWipe) | CCoinsViewDB::CCoinsViewDB(fs::path ldb_path, size_t nCacheSize, bool fMemory, | ||||
: db(GetDataDir() / "chainstate", nCacheSize, fMemory, fWipe, true) {} | bool fWipe) | ||||
: db(ldb_path, nCacheSize, fMemory, fWipe, true) {} | |||||
bool CCoinsViewDB::GetCoin(const COutPoint &outpoint, Coin &coin) const { | bool CCoinsViewDB::GetCoin(const COutPoint &outpoint, Coin &coin) const { | ||||
return db.Read(CoinEntry(&outpoint), coin); | return db.Read(CoinEntry(&outpoint), coin); | ||||
} | } | ||||
bool CCoinsViewDB::HaveCoin(const COutPoint &outpoint) const { | bool CCoinsViewDB::HaveCoin(const COutPoint &outpoint) const { | ||||
return db.Exists(CoinEntry(&outpoint)); | return db.Exists(CoinEntry(&outpoint)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 383 Lines • Show Last 20 Lines |