| 203 | } |
| 204 | |
| 205 | bool Exists(const std::string &key) { |
| 206 | leveldb::Slice slKey(key); |
| 207 | string strValue; |
| 208 | leveldb::Status status = pdb->Get(readoptions, slKey, &strValue); |
| 209 | if (!status.ok()) { |
| 210 | if (status.IsNotFound()) |
| 211 | return false; |
| 212 | LogPrint(BCLog::INFO,"LevelDB read failure: %s\n", status.ToString().c_str()); |
| 213 | ThrowError(status); |
| 214 | } |
| 215 | return true; |
| 216 | } |
| 217 | |
| 218 | bool Erase(const string& key, bool fSync = false) { |
| 219 | CLevelDBBatch batch; |
no test coverage detected