MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / remove

Function remove

src/Chain/libraries/include/db/LevelMap.hpp:397–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395 }
396
397 void remove(const Key& k, bool sync = false)
398 {
399 try {
400 FC_ASSERT(is_open(), "Database is not open!");
401
402 std::vector<char> kslice = fc::raw::pack(k);
403 ldb::Slice ks(kslice.data(), kslice.size());
404 auto status = _db->Delete(sync ? _sync_options : _write_options, ks);
405 if (!status.ok())
406 {
407 FC_THROW_EXCEPTION(level_map_failure, "database error: ${msg}", ("msg", status.ToString()));
408 }
409 } FC_RETHROW_EXCEPTIONS(warn, "error removing ${key}", ("key", k));
410 }
411
412 void export_to_json(const fc::path& path)const
413 {

Callers 5

fetch_optionalMethod · 0.70
Client.cppFile · 0.50
os_removeFunction · 0.50
process_cmd_infoMethod · 0.50
ChainInterfaceClass · 0.50

Calls 6

is_openFunction · 0.70
packFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45
okMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected