aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/db.h
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2016-08-23 15:36:23 +0200
committerJonas Schnelli <dev@jonasschnelli.ch>2016-08-23 15:36:23 +0200
commitbeef966e365e16a9b041321e404f7cd21a4e999e (patch)
tree91b9430b34c7e0903fa4d121f8b93e93609acd58 /src/wallet/db.h
parent41d8e78f94c5ad54684f1f15efb0264036418e71 (diff)
downloadbitcoin-beef966e365e16a9b041321e404f7cd21a4e999e.tar.xz
[Wallet] remove unused code/conditions in ReadAtCursor
Diffstat (limited to 'src/wallet/db.h')
-rw-r--r--src/wallet/db.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/wallet/db.h b/src/wallet/db.h
index 01b8c71a04..a0f673ecfc 100644
--- a/src/wallet/db.h
+++ b/src/wallet/db.h
@@ -228,19 +228,17 @@ protected:
return pcursor;
}
- int ReadAtCursor(Dbc* pcursor, CDataStream& ssKey, CDataStream& ssValue, unsigned int fFlags = DB_NEXT)
+ int ReadAtCursor(Dbc* pcursor, CDataStream& ssKey, CDataStream& ssValue, bool setRange = false)
{
// Read at cursor
Dbt datKey;
- if (fFlags == DB_SET || fFlags == DB_SET_RANGE || fFlags == DB_GET_BOTH || fFlags == DB_GET_BOTH_RANGE) {
+ unsigned int fFlags = DB_NEXT;
+ if (setRange) {
datKey.set_data(&ssKey[0]);
datKey.set_size(ssKey.size());
+ fFlags = DB_SET_RANGE;
}
Dbt datValue;
- if (fFlags == DB_GET_BOTH || fFlags == DB_GET_BOTH_RANGE) {
- datValue.set_data(&ssValue[0]);
- datValue.set_size(ssValue.size());
- }
datKey.set_flags(DB_DBT_MALLOC);
datValue.set_flags(DB_DBT_MALLOC);
int ret = pcursor->get(&datKey, &datValue, fFlags);