From dd7fc1aa055b4d7037883f1ecd0a412d583c3724 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Thu, 18 Nov 2021 15:40:27 +0000 Subject: [PATCH] Better source sync --- src/offshore/pricing_record.cpp | 1 + src/offshore/pricing_record.h | 71 +-------------------------------- 2 files changed, 2 insertions(+), 70 deletions(-) diff --git a/src/offshore/pricing_record.cpp b/src/offshore/pricing_record.cpp index 678b166..2847b09 100644 --- a/src/offshore/pricing_record.cpp +++ b/src/offshore/pricing_record.cpp @@ -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++) { diff --git a/src/offshore/pricing_record.h b/src/offshore/pricing_record.h index 93f3889..74c76b6 100644 --- a/src/offshore/pricing_record.h +++ b/src/offshore/pricing_record.h @@ -42,6 +42,7 @@ #include #include #include + #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;