Skip to content

Commit 8021392

Browse files
committed
Merge #17405: wallet: Remove unused boost::this_thread::interruption_point
fad1de6 wallet: Remove unused boost::this_thread::interruption_point (MarcoFalke) Pull request description: `BerkeleyEnvironment::Open` is only called from the main thread (init) or an http rpc thread, neither of which can be interrupted, so remove the useless interruption point. `BerkeleyEnvironment{}` is only used in tests, which run in a single process/thread, so remove the useless interruption point. ACKs for top commit: laanwj: ACK fad1de6 fanquake: ACK fad1de6 Tree-SHA512: dacd8398e966e4a6ce5cf7d3ed821c9c267eff40b14c0635085441647cdb72d1642807f89355419f1710f814c7963e35a10d102d0b985c7198261dfc736256f8
2 parents 4a3b6f4 + fad1de6 commit 8021392

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/wallet/db.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,9 @@ BerkeleyEnvironment::~BerkeleyEnvironment()
166166

167167
bool BerkeleyEnvironment::Open(bool retry)
168168
{
169-
if (fDbEnvInit)
169+
if (fDbEnvInit) {
170170
return true;
171-
172-
boost::this_thread::interruption_point();
171+
}
173172

174173
fs::path pathIn = strPath;
175174
TryCreateDirectories(pathIn);
@@ -238,13 +237,11 @@ bool BerkeleyEnvironment::Open(bool retry)
238237
return true;
239238
}
240239

241-
//! Construct an in-memory mock Berkeley environment for testing and as a place-holder for g_dbenvs emplace
240+
//! Construct an in-memory mock Berkeley environment for testing
242241
BerkeleyEnvironment::BerkeleyEnvironment()
243242
{
244243
Reset();
245244

246-
boost::this_thread::interruption_point();
247-
248245
LogPrint(BCLog::DB, "BerkeleyEnvironment::MakeMock\n");
249246

250247
dbenv->set_cachesize(1, 0, 1);
@@ -263,8 +260,9 @@ BerkeleyEnvironment::BerkeleyEnvironment()
263260
DB_THREAD |
264261
DB_PRIVATE,
265262
S_IRUSR | S_IWUSR);
266-
if (ret > 0)
263+
if (ret > 0) {
267264
throw std::runtime_error(strprintf("BerkeleyEnvironment::MakeMock: Error %d opening database environment.", ret));
265+
}
268266

269267
fDbEnvInit = true;
270268
fMockDb = true;

0 commit comments

Comments
 (0)