MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ReadImpl

Method ReadImpl

src/dbwrapper.cpp:322–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320}
321
322std::optional<std::string> CDBWrapper::ReadImpl(std::span<const std::byte> key) const
323{
324 leveldb::Slice slKey(CharCast(key.data()), key.size());
325 std::string strValue;
326 leveldb::Status status = DBContext().pdb->Get(DBContext().readoptions, slKey, &strValue);
327 if (!status.ok()) {
328 if (status.IsNotFound())
329 return std::nullopt;
330 LogError("LevelDB read failure: %s", status.ToString());
331 HandleError(status);
332 }
333 return strValue;
334}
335
336bool CDBWrapper::ExistsImpl(std::span<const std::byte> key) const
337{

Callers

nothing calls this directly

Calls 6

HandleErrorFunction · 0.85
CharCastFunction · 0.70
dataMethod · 0.45
sizeMethod · 0.45
GetMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected