aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/dump.cpp
diff options
context:
space:
mode:
authorAndrew Chow <github@achow101.com>2022-11-29 22:34:26 -0500
committerAndrew Chow <github@achow101.com>2022-12-16 12:35:54 -0500
commit4aebd832a405090c2608e4b60bb4f34501bcea61 (patch)
tree81685d6a591416a0560d0e94d4003a5f2fec8593 /src/wallet/dump.cpp
parentd79e8dcf2981ef1964a2fde8c472b5de1ca1c963 (diff)
downloadbitcoin-4aebd832a405090c2608e4b60bb4f34501bcea61.tar.xz
db: Change DatabaseCursor::Next to return status enum
Next()'s result is a tri-state - failed, more to go, complete. Replace the way that this is returned with an enum with values FAIL, MORE, and DONE rather than with two booleans.
Diffstat (limited to 'src/wallet/dump.cpp')
-rw-r--r--src/wallet/dump.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/dump.cpp b/src/wallet/dump.cpp
index ed3b05f118..2655111532 100644
--- a/src/wallet/dump.cpp
+++ b/src/wallet/dump.cpp
@@ -69,13 +69,13 @@ bool DumpWallet(const ArgsManager& args, CWallet& wallet, bilingual_str& error)
while (true) {
CDataStream ss_key(SER_DISK, CLIENT_VERSION);
CDataStream ss_value(SER_DISK, CLIENT_VERSION);
- bool complete;
- ret = cursor->Next(ss_key, ss_value, complete);
- if (complete) {
+ DatabaseCursor::Status status = cursor->Next(ss_key, ss_value);
+ if (status == DatabaseCursor::Status::DONE) {
ret = true;
break;
- } else if (!ret) {
+ } else if (status == DatabaseCursor::Status::FAIL) {
error = _("Error reading next record from wallet database");
+ ret = false;
break;
}
std::string key_str = HexStr(ss_key);