Skip to content
This repository has been archived by the owner on Oct 12, 2020. It is now read-only.

Commit

Permalink
backported pricing record signature so that mainline code can share a…
Browse files Browse the repository at this point in the history
… DB with offshore test code
  • Loading branch information
Neil Coggins committed Aug 16, 2019
1 parent c65e5c0 commit b859feb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 19 deletions.
3 changes: 2 additions & 1 deletion src/blockchain_db/lmdb/db_lmdb.cpp.patch
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@
return;
}
// Note that there was a schema change within version 0 as well.
@@ -5227,5 +5230,6 @@ void BlockchainLMDB::migrate_4_5()
@@ -5227,6 +5230,7 @@ void BlockchainLMDB::migrate_4_5()
bi.bi_hash = bi_old->bi_hash;
bi.bi_cum_rct = bi_old->bi_cum_rct;
bi.bi_long_term_block_weight = bi_old->bi_long_term_block_weight;
+ memset(&bi.bi_pricing_record, 0, sizeof(offshore::pricing_record));

MDB_val_set(nv, bi);
result = mdb_cursor_put(c_cur, (MDB_val *)&zerokval, &nv, MDB_APPENDDUP);
35 changes: 18 additions & 17 deletions src/offshore/offshore_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,30 @@
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#pragma once
#include <cstdint>
#include "common/pod-class.h"

namespace offshore {

#pragma pack(push, 1)
POD_CLASS pricing_record {
double xAG;
double xAU;
double xAUD;
double xBTC;
double xCAN;
double xCHF;
double xCNY;
double xEUR;
double xGBP;
double xJPY;
double xNOK;
double xNZD;
double xUSD;
double unused1;
double unused2;
double unused3;
char signature[32];
uint64_t xAG;
uint64_t xAU;
uint64_t xAUD;
uint64_t xBTC;
uint64_t xCAN;
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;
char signature[64];
};
#pragma pack(pop)
}
2 changes: 1 addition & 1 deletion src/offshore/pricing_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace offshore {

PricingHandler::PricingHandler()
: m_current_record{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, "\0"}
: m_current_record{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "\0"}
{
}

Expand Down

0 comments on commit b859feb

Please sign in to comment.