Better source sync

This commit is contained in:
MoneroOcean
2021-11-18 15:40:27 +00:00
parent f5ccc22d2c
commit dd7fc1aa05
2 changed files with 2 additions and 70 deletions

View File

@@ -295,6 +295,7 @@ namespace offshore
BIO_free(bio);
CHECK_AND_ASSERT_THROW_MES(pubkey != NULL, "Pricing record verification failed. NULL public key.");
// Convert our internal 64-byte binary representation into 128-byte hex string
std::string sig_hex;
for (unsigned int i=0; i<64; i++) {

View File

@@ -42,6 +42,7 @@
#include <cstdint>
#include <string>
#include <cstring>
#include "cryptonote_config.h"
#include "crypto/hash.h"
@@ -136,76 +137,6 @@ namespace offshore
class pricing_record_v1
{
public:
uint64_t xAG;
uint64_t xAU;
uint64_t xAUD;
uint64_t xBTC;
uint64_t xCAD;
uint64_t xCHF;
uint64_t xCNY;
uint64_t xEUR;
uint64_t xGBP;
uint64_t xJPY;
uint64_t xNOK;
uint64_t xNZD;
uint64_t xUSD;
uint64_t unused1;
uint64_t unused2;
uint64_t unused3;
uint64_t timestamp;
unsigned char signature[64];
bool write_to_pr(offshore::pricing_record &pr)
{
pr.xAG = xAG;
pr.xAU = xAU;
pr.xAUD = xAUD;
pr.xBTC = xBTC;
pr.xCAD = xCAD;
pr.xCHF = xCHF;
pr.xCNY = xCNY;
pr.xEUR = xEUR;
pr.xGBP = xGBP;
pr.xJPY = xJPY;
pr.xNOK = xNOK;
pr.xNZD = xNZD;
pr.xUSD = xUSD;
pr.unused1 = unused1;
pr.unused2 = unused2;
pr.unused3 = unused3;
pr.timestamp = 0;
::memcpy(pr.signature, signature, sizeof(pr.signature));
return true;
};
bool read_from_pr(offshore::pricing_record &pr)
{
xAG = pr.xAG;
xAU = pr.xAU;
xAUD = pr.xAUD;
xBTC = pr.xBTC;
xCAD = pr.xCAD;
xCHF = pr.xCHF;
xCNY = pr.xCNY;
xEUR = pr.xEUR;
xGBP = pr.xGBP;
xJPY = pr.xJPY;
xNOK = pr.xNOK;
xNZD = pr.xNZD;
xUSD = pr.xUSD;
unused1 = pr.unused1;
unused2 = pr.unused2;
unused3 = pr.unused3;
::memcpy(signature, pr.signature, sizeof(signature));
return true;
};
};
// did not have a timestamp
class pricing_record_v1
{
public:
uint64_t xAG;
uint64_t xAU;