Better source sync
This commit is contained in:
@@ -295,6 +295,7 @@ namespace offshore
|
|||||||
BIO_free(bio);
|
BIO_free(bio);
|
||||||
CHECK_AND_ASSERT_THROW_MES(pubkey != NULL, "Pricing record verification failed. NULL public key.");
|
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
|
// Convert our internal 64-byte binary representation into 128-byte hex string
|
||||||
std::string sig_hex;
|
std::string sig_hex;
|
||||||
for (unsigned int i=0; i<64; i++) {
|
for (unsigned int i=0; i<64; i++) {
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include "cryptonote_config.h"
|
#include "cryptonote_config.h"
|
||||||
#include "crypto/hash.h"
|
#include "crypto/hash.h"
|
||||||
|
|
||||||
@@ -136,76 +137,6 @@ namespace offshore
|
|||||||
class pricing_record_v1
|
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:
|
public:
|
||||||
uint64_t xAG;
|
uint64_t xAG;
|
||||||
uint64_t xAU;
|
uint64_t xAU;
|
||||||
|
|||||||
Reference in New Issue
Block a user