diff options
author | Andrew Chow <github@achow101.com> | 2022-11-29 22:34:26 -0500 |
---|---|---|
committer | Andrew Chow <github@achow101.com> | 2022-12-16 12:35:54 -0500 |
commit | 4aebd832a405090c2608e4b60bb4f34501bcea61 (patch) | |
tree | 81685d6a591416a0560d0e94d4003a5f2fec8593 /src/wallet/db.h | |
parent | d79e8dcf2981ef1964a2fde8c472b5de1ca1c963 (diff) | |
download | bitcoin-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/db.h')
-rw-r--r-- | src/wallet/db.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/wallet/db.h b/src/wallet/db.h index 3373bd1de2..d040af0d14 100644 --- a/src/wallet/db.h +++ b/src/wallet/db.h @@ -31,7 +31,14 @@ public: DatabaseCursor(const DatabaseCursor&) = delete; DatabaseCursor& operator=(const DatabaseCursor&) = delete; - virtual bool Next(CDataStream& key, CDataStream& value, bool& complete) { return false; } + enum class Status + { + FAIL, + MORE, + DONE, + }; + + virtual Status Next(CDataStream& key, CDataStream& value) { return Status::FAIL; } }; /** RAII class that provides access to a WalletDatabase */ @@ -168,7 +175,7 @@ public: class DummyCursor : public DatabaseCursor { - bool Next(CDataStream& key, CDataStream& value, bool& complete) override { return false; } + Status Next(CDataStream& key, CDataStream& value) override { return Status::FAIL; } }; /** RAII class that provides access to a DummyDatabase. Never fails. */ |