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

Method Verify

src/wallet/db.cpp:233–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233BerkeleyEnvironment::VerifyResult BerkeleyEnvironment::Verify(const std::string& strFile, recoverFunc_type recoverFunc, std::string& out_backup_filename)
234{
235 LOCK(cs_db);
236 assert(mapFileUseCount.count(strFile) == 0);
237
238 Db db(dbenv.get(), 0);
239 int result = db.verify(strFile.c_str(), nullptr, nullptr, 0);
240 if (result == 0)
241 return VerifyResult::VERIFY_OK;
242 else if (recoverFunc == nullptr)
243 return VerifyResult::RECOVER_FAIL;
244
245 // Try to recover:
246 bool fRecovered = (*recoverFunc)(fs::path(strPath) / strFile, out_backup_filename);
247 return (fRecovered ? VerifyResult::RECOVER_OK : VerifyResult::RECOVER_FAIL);
248}
249
250bool BerkeleyBatch::Recover(const fs::path& file_path, void *callbackDataIn, bool (*recoverKVcallback)(void* callbackData, CDataStream ssKey, CDataStream ssValue), std::string& newFilename)
251{

Callers 3

VerifyDatabaseFileMethod · 0.45
VerifySignatureMethod · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45

Calls 3

getMethod · 0.80
countMethod · 0.45
verifyMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.36