From 32e2ea658cd7e0966baea435fa5d46df8ed84a3b Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Tue, 13 Dec 2022 23:22:55 -0500 Subject: Move this api for consistency Sorry if you were using it (99.99% chance you weren't) --- database.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'database.cpp') diff --git a/database.cpp b/database.cpp index 4f284f15..af2a8a29 100644 --- a/database.cpp +++ b/database.cpp @@ -334,6 +334,19 @@ Ref Snapshot::ReadData(const std::function& } +bool Snapshot::StoreData(const Ref& data, const std::function& 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 other) { return BNSnapshotHasAncestor(m_object, other->GetObject()); @@ -396,19 +409,6 @@ int64_t Database::WriteSnapshotData(std::vector parents, Ref& data, const std::function& 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)) -- cgit v1.3.1