diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2023-07-06 18:23:23 +0000 |
---|---|---|
committer | Cory Fields <cory-nospam-@coryfields.com> | 2023-07-06 20:16:55 +0000 |
commit | 4216f69250937b1ca4650dc0c21678a8444c6650 (patch) | |
tree | 4e117a9385f78906b95e91fe4735ca4a933c8b53 /src/wallet | |
parent | 43369f37060a1b4c987672707c500d35c9a27c1d (diff) |
wallet: bdb: move TxnBegin to cpp file since it uses a bdb function
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/bdb.cpp | 9 | ||||
-rw-r--r-- | src/wallet/bdb.h | 9 |
2 files changed, 10 insertions, 8 deletions
diff --git a/src/wallet/bdb.cpp b/src/wallet/bdb.cpp index e17359f150..e08391547a 100644 --- a/src/wallet/bdb.cpp +++ b/src/wallet/bdb.cpp @@ -462,6 +462,15 @@ void BerkeleyEnvironment::ReloadDbEnv() Open(open_err); } +DbTxn* BerkeleyEnvironment::TxnBegin(int flags) +{ + DbTxn* ptxn = nullptr; + int ret = dbenv->txn_begin(nullptr, &ptxn, flags); + if (!ptxn || ret != 0) + return nullptr; + return ptxn; +} + bool BerkeleyDatabase::Rewrite(const char* pszSkip) { while (true) { diff --git a/src/wallet/bdb.h b/src/wallet/bdb.h index e10ebbbdfd..9552d8ce25 100644 --- a/src/wallet/bdb.h +++ b/src/wallet/bdb.h @@ -67,14 +67,7 @@ public: void CloseDb(const fs::path& filename); void ReloadDbEnv(); - DbTxn* TxnBegin(int flags) - { - DbTxn* ptxn = nullptr; - int ret = dbenv->txn_begin(nullptr, &ptxn, flags); - if (!ptxn || ret != 0) - return nullptr; - return ptxn; - } + DbTxn* TxnBegin(int flags); }; /** Get BerkeleyEnvironment given a directory path. */ |