MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / MakeMock

Method MakeMock

src/wallet/db.cpp:133–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133void CDBEnv::MakeMock()
134{
135 if (fDbEnvInit)
136 throw runtime_error("CDBEnv::MakeMock: Already initialized");
137
138 boost::this_thread::interruption_point();
139
140 LogPrint(BCLog::CDB, "CDBEnv::MakeMock\n");
141
142 dbenv->set_cachesize(1, 0, 1);
143 dbenv->set_lg_bsize(10485760 * 4);
144 dbenv->set_lg_max(10485760);
145 dbenv->set_lk_max_locks(10000);
146 dbenv->set_lk_max_objects(10000);
147 dbenv->set_flags(DB_AUTO_COMMIT, 1);
148 dbenv->log_set_config(DB_LOG_IN_MEMORY, 1);
149 int ret = dbenv->open(NULL,
150 DB_CREATE |
151 DB_INIT_LOCK |
152 DB_INIT_LOG |
153 DB_INIT_MPOOL |
154 DB_INIT_TXN |
155 DB_THREAD |
156 DB_PRIVATE,
157 S_IRUSR | S_IWUSR);
158 if (ret > 0)
159 throw runtime_error(strprintf("CDBEnv::MakeMock: Error %d opening database environment.", ret));
160
161 fDbEnvInit = true;
162 fMockDb = true;
163}
164
165CDBEnv::VerifyResult CDBEnv::Verify(std::string strFile, bool (*recoverFunc)(CDBEnv& dbenv, std::string strFile))
166{

Callers

nothing calls this directly

Calls 1

openMethod · 0.80

Tested by

no test coverage detected