Skip to content

Commit 1722e83

Browse files
fanquakeUdjinM6
authored andcommitted
Merge bitcoin#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
1 parent c555352 commit 1722e83

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
@@ -151,10 +151,9 @@ BerkeleyEnvironment::~BerkeleyEnvironment()
151151

152152
bool BerkeleyEnvironment::Open(bool retry)
153153
{
154-
if (fDbEnvInit)
154+
if (fDbEnvInit) {
155155
return true;
156-
157-
boost::this_thread::interruption_point();
156+
}
158157

159158
fs::path pathIn = strPath;
160159
TryCreateDirectories(pathIn);
@@ -223,13 +222,11 @@ bool BerkeleyEnvironment::Open(bool retry)
223222
return true;
224223
}
225224

226-
//! Construct an in-memory mock Berkeley environment for testing and as a place-holder for g_dbenvs emplace
225+
//! Construct an in-memory mock Berkeley environment for testing
227226
BerkeleyEnvironment::BerkeleyEnvironment()
228227
{
229228
Reset();
230229

231-
boost::this_thread::interruption_point();
232-
233230
LogPrint(BCLog::DB, "BerkeleyEnvironment::MakeMock\n");
234231

235232
dbenv->set_cachesize(1, 0, 1);
@@ -248,8 +245,9 @@ BerkeleyEnvironment::BerkeleyEnvironment()
248245
DB_THREAD |
249246
DB_PRIVATE,
250247
S_IRUSR | S_IWUSR);
251-
if (ret > 0)
248+
if (ret > 0) {
252249
throw std::runtime_error(strprintf("BerkeleyEnvironment::MakeMock: Error %d opening database environment.", ret));
250+
}
253251

254252
fDbEnvInit = true;
255253
fMockDb = true;

0 commit comments

Comments
 (0)