summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-11-15 09:39:31 +0100
committerChristian Grothoff <christian@grothoff.org>2019-11-15 09:39:31 +0100
commit9badf80eb4228a9c009839a4856710127efe8601 (patch)
treeec62e28f2ab3b90ca374537a9b2730b1fecdbb93 /src/include
parentd0e22221b9fd3627d63e484b8957337d2638a871 (diff)
downloadsync-9badf80eb4228a9c009839a4856710127efe8601.tar.gz
sync-9badf80eb4228a9c009839a4856710127efe8601.tar.bz2
sync-9badf80eb4228a9c009839a4856710127efe8601.zip
implement GET logic
Diffstat (limited to 'src/include')
-rw-r--r--src/include/sync_database_plugin.h19
-rw-r--r--src/include/sync_service.h2
2 files changed, 19 insertions, 2 deletions
diff --git a/src/include/sync_database_plugin.h b/src/include/sync_database_plugin.h
index cdc65e9..d5759ee 100644
--- a/src/include/sync_database_plugin.h
+++ b/src/include/sync_database_plugin.h
@@ -38,7 +38,7 @@ enum SYNC_DB_QueryStatus
SYNC_DB_OLD_BACKUP_MISSMATCH = -4,
/**
- * Account is unpaid.
+ * Account is unpaid / does not exist.
*/
SYNC_DB_PAYMENT_REQUIRED = -3,
@@ -153,12 +153,28 @@ struct SYNC_DatabasePlugin
size_t backup_size,
const void *backup);
+
+ /**
+ * Lookup an account and associated backup meta data.
+ *
+ * @param cls closure
+ * @param account_pub account to store @a backup under
+ * @param backup_hash[OUT] set to hash of @a backup
+ * @return transaction status
+ */
+ enum SYNC_DB_QueryStatus
+ (*lookup_account_TR)(void *cls,
+ const struct SYNC_AccountPublicKeyP *account_pub,
+ struct GNUNET_HashCode *backup_hash);
+
+
/**
* Obtain backup.
*
* @param cls closure
* @param account_pub account to store @a backup under
* @param account_sig[OUT] set to signature affirming storage request
+ * @param prev_hash[OUT] set to hash of the previous @a backup (all zeros if none)
* @param backup_hash[OUT] set to hash of @a backup
* @param backup_size[OUT] set to number of bytes in @a backup
* @param backup[OUT] set to raw data to backup, caller MUST FREE
@@ -167,6 +183,7 @@ struct SYNC_DatabasePlugin
(*lookup_backup_TR)(void *cls,
const struct SYNC_AccountPublicKeyP *account_pub,
struct SYNC_AccountSignatureP *account_sig,
+ struct GNUNET_HashCode *prev_hash,
struct GNUNET_HashCode *backup_hash,
size_t *backup_size,
void **backup);
diff --git a/src/include/sync_service.h b/src/include/sync_service.h
index e99d0c3..20bbe67 100644
--- a/src/include/sync_service.h
+++ b/src/include/sync_service.h
@@ -46,7 +46,7 @@ struct SYNC_AccountPublicKeyP
/**
* We use EdDSA.
*/
- struct GNUNET_CRYPTO_EddsaPrivateKey eddsa_priv;
+ struct GNUNET_CRYPTO_EddsaPublicKey eddsa_pub;
};