MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / Exists

Method Exists

src/dbwrapper.h:265–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263
264 template <typename K>
265 bool Exists(const K& key) const
266 {
267 CDataStream ssKey(SER_DISK, CLIENT_VERSION);
268 ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);
269 ssKey << key;
270 leveldb::Slice slKey(ssKey.data(), ssKey.size());
271
272 std::string strValue;
273 leveldb::Status status = pdb->Get(readoptions, slKey, &strValue);
274 if (!status.ok()) {
275 if (status.IsNotFound())
276 return false;
277 LogPrintf("LevelDB read failure: %s\n", status.ToString());
278 dbwrapper_private::HandleError(status);
279 }
280 return true;
281 }
282
283 template <typename K>
284 bool Erase(const K& key, bool fSync = false)

Callers 1

HaveCoinMethod · 0.45

Calls 8

HandleErrorFunction · 0.85
IsNotFoundMethod · 0.80
reserveMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
GetMethod · 0.45
okMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected