aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/db.cpp
diff options
context:
space:
mode:
authorAva Chow <github@achow101.com>2024-01-02 16:35:22 -0500
committerAva Chow <github@achow101.com>2024-05-13 23:01:37 -0400
commit0c8e72847603540bb29b8b8aeb80fa3f2e3a2c9a (patch)
tree3ad7d3dafb7257f8031fc8c5f9f2171d22e8eb2d /src/wallet/db.cpp
parent756ff9b478484b17c4a6e65c171c2e4fecb21ad4 (diff)
downloadbitcoin-0c8e72847603540bb29b8b8aeb80fa3f2e3a2c9a.tar.xz
wallet: implement BerkeleyROBatch
Implement ReadKey and HasKey of BerkeleyROBatch, and Next of BerkeleyROCursor. Also adds the containers for records to BerkeleyRODatabase so that BerkeleyROBatch will be able to access the records.
Diffstat (limited to 'src/wallet/db.cpp')
-rw-r--r--src/wallet/db.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp
index ea06767e9b..a5a5f8ec6f 100644
--- a/src/wallet/db.cpp
+++ b/src/wallet/db.cpp
@@ -16,6 +16,9 @@
#include <vector>
namespace wallet {
+bool operator<(BytePrefix a, Span<const std::byte> b) { return a.prefix < b.subspan(0, std::min(a.prefix.size(), b.size())); }
+bool operator<(Span<const std::byte> a, BytePrefix b) { return a.subspan(0, std::min(a.size(), b.prefix.size())) < b.prefix; }
+
std::vector<fs::path> ListDatabases(const fs::path& wallet_dir)
{
std::vector<fs::path> paths;