aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/bdb.h
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2020-05-14 21:17:01 -0400
committerAndrew Chow <achow101-github@achow101.com>2020-06-22 15:36:23 -0400
commitca24edfbc1941ed0a3c9586416dae4e84794eb66 (patch)
tree1cd6eb3d10bb421f399d98df1c7a4340afb1a59c /src/wallet/bdb.h
parent39bd9ddb8783807b9cde6288233e86ad7c85d61f (diff)
walletdb: Handle cursor internally
Instead of returning a Dbc (BDB cursor object) and having the caller deal with the cursor, make BerkeleyBatch handle the cursor internally. This prepares BerkeleyBatch to work with other database systems as Dbc objects are BDB specific.
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 5ed364344b..aac5bc016e 100644
--- a/src/wallet/bdb.h
+++ b/src/wallet/bdb.h
@@ -211,6 +211,7 @@ protected:
Db* pdb;
std::string strFile;
DbTxn* activeTxn;
+ Dbc* m_cursor;
bool fReadOnly;
bool fFlushOnClose;
BerkeleyEnvironment *env;
@@ -323,8 +324,9 @@ public:
return (ret == 0);
}
- 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();