aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/bdb.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2020-07-01 15:47:36 +0200
committerWladimir J. van der Laan <laanwj@protonmail.com>2020-07-01 16:00:32 +0200
commit26291745aed080cb2d8576736a23869df603dec2 (patch)
tree4c36257c77b549f9aebb447d4252bb0a0df9b92f /src/wallet/bdb.h
parentbb588669f9e84011969b67f807f12c3480489955 (diff)
parentca24edfbc1941ed0a3c9586416dae4e84794eb66 (diff)
downloadbitcoin-26291745aed080cb2d8576736a23869df603dec2.tar.xz
Merge #19308: wallet: BerkeleyBatch Handle cursor internally
ca24edfbc1941ed0a3c9586416dae4e84794eb66 walletdb: Handle cursor internally (Andrew Chow) Pull request description: Instead of returning a Dbc (BDB cursor object) and having the caller deal with the cursor, make BerkeleyBatch handle the cursor internally. Split from #18971 ACKs for top commit: ryanofsky: Code review ACK ca24edfbc1941ed0a3c9586416dae4e84794eb66. Changes since last review: StartCursor rename, moving CloseCursor calls near returns promag: Code review ACK ca24edfbc1941ed0a3c9586416dae4e84794eb66. Tree-SHA512: f029b498c7f275aedca53ce7ade7cb99c82975fd6cad17346a4990fb3bcc54e2a5309b32053bd13def9ee464d331b036ac79abb8fc4fa561170c6cfc85283447
Diffstat (limited to 'src/wallet/bdb.h')
-rw-r--r--src/wallet/bdb.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wallet/bdb.h b/src/wallet/bdb.h
index c121bb4228..ee9cfa46b1 100644
--- a/src/wallet/bdb.h
+++ b/src/wallet/bdb.h
@@ -198,6 +198,7 @@ protected:
Db* pdb;
std::string strFile;
DbTxn* activeTxn;
+ Dbc* m_cursor;
bool fReadOnly;
bool fFlushOnClose;
BerkeleyEnvironment *env;
@@ -284,8 +285,9 @@ public:
return HasKey(ssKey);
}
- Dbc* GetCursor();
- int ReadAtCursor(Dbc* pcursor, CDataStream& ssKey, CDataStream& ssValue);
+ bool StartCursor();
+ bool ReadAtCursor(CDataStream& ssKey, CDataStream& ssValue, bool& complete);
+ void CloseCursor();
bool TxnBegin();
bool TxnCommit();
bool TxnAbort();