summaryrefslogtreecommitdiff
path: root/database.cpp
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2022-12-13 23:22:55 -0500
committerGlenn Smith <glenn@vector35.com>2023-01-03 19:21:04 -0500
commit32e2ea658cd7e0966baea435fa5d46df8ed84a3b (patch)
tree73b64f85d04e5610c4c87d74fa070106fafc2d23 /database.cpp
parent41c6935322289be0798ba3e767cfb3ab8a3ec79b (diff)
Move this api for consistency
Sorry if you were using it (99.99% chance you weren't)
Diffstat (limited to 'database.cpp')
-rw-r--r--database.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/database.cpp b/database.cpp
index 4f284f15..af2a8a29 100644
--- a/database.cpp
+++ b/database.cpp
@@ -334,6 +334,19 @@ Ref<KeyValueStore> Snapshot::ReadData(const std::function<bool(size_t, size_t)>&
}
+bool Snapshot::StoreData(const Ref<KeyValueStore>& data, const std::function<bool(size_t, size_t)>& progress)
+{
+ ProgressContext pctxt;
+ pctxt.callback = progress;
+ bool result = BNSnapshotStoreData(m_object, data->GetObject(), &pctxt, ProgressCallback);
+ if (!result)
+ {
+ throw DatabaseException("BNSnapshotStoreData");
+ }
+ return result;
+}
+
+
bool Snapshot::HasAncestor(Ref<Snapshot> other)
{
return BNSnapshotHasAncestor(m_object, other->GetObject());
@@ -396,19 +409,6 @@ int64_t Database::WriteSnapshotData(std::vector<int64_t> parents, Ref<BinaryView
}
-bool Database::StoreDataForSnapshot(int64_t id, const Ref<KeyValueStore>& data, const std::function<bool(size_t, size_t)>& progress)
-{
- ProgressContext pctxt;
- pctxt.callback = progress;
- bool result = BNStoreDataForSnapshot(m_object, id, data->GetObject(), &pctxt, ProgressCallback);
- if (!result)
- {
- throw DatabaseException("BNStoreDataForSnapshot");
- }
- return result;
-}
-
-
void Database::TrimSnapshot(int64_t id)
{
if (!BNTrimDatabaseSnapshot(m_object, id))