From db964c12c83f53d8d0ab809a81a9e7f5f6f99bac Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Fri, 14 Sep 2018 08:38:10 +0800 Subject: [PATCH] Temprorary make it compile with ubuntu 16.04 branch --- CMakeLists.txt | 1 + src/CurrentBlockchainStatus.cpp | 4 ++-- src/MicroCore.cpp | 4 ++-- src/page.h | 20 ++++++++++---------- src/rpccalls.cpp | 4 ++-- src/tools.cpp | 5 ++--- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d8f8e6..06574b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,6 +120,7 @@ set(LIBRARIES version epee pcsclite + sodium ${Boost_LIBRARIES} pthread unbound diff --git a/src/CurrentBlockchainStatus.cpp b/src/CurrentBlockchainStatus.cpp index 1a4b1ab..5a686d7 100644 --- a/src/CurrentBlockchainStatus.cpp +++ b/src/CurrentBlockchainStatus.cpp @@ -137,8 +137,8 @@ CurrentBlockchainStatus::calculate_emission_in_blocks( uint64_t coinbase_amount = get_outs_money_amount(blk.miner_tx); - std::list txs; - std::list missed_txs; + std::vector txs; + std::vector missed_txs; uint64_t tx_fee_amount = 0; diff --git a/src/MicroCore.cpp b/src/MicroCore.cpp index 19f41d8..30a7652 100644 --- a/src/MicroCore.cpp +++ b/src/MicroCore.cpp @@ -235,8 +235,8 @@ MicroCore::get_tx_hash_from_output_pubkey(const public_key& output_pubkey, // get all transactions in the block found // initialize the first list with transaction for solving // the block i.e. coinbase. - list txs {blk.miner_tx}; - list missed_txs; + vector txs {blk.miner_tx}; + vector missed_txs; if (!m_blockchain_storage.get_transactions(blk.tx_hashes, txs, missed_txs)) { diff --git a/src/page.h b/src/page.h index c903392..5eb694b 100644 --- a/src/page.h +++ b/src/page.h @@ -583,7 +583,7 @@ public: crypto::hash blk_hash = core_storage->get_block_id_by_height(i); // get block size in kB - double blk_size = static_cast(core_storage->get_db().get_block_size(i))/1024.0; + double blk_size = static_cast(core_storage->get_db().get_block_weight(i))/1024.0; string blk_size_str = fmt::format("{:0.2f}", blk_size); @@ -716,8 +716,8 @@ public: // get all transactions in the block found // initialize the first list with transaction for solving // the block i.e. coinbase. - list blk_txs {blk.miner_tx}; - list missed_txs; + vector blk_txs {blk.miner_tx}; + vector missed_txs; if (!core_storage->get_transactions(blk.tx_hashes, blk_txs, missed_txs)) { @@ -1157,7 +1157,7 @@ public: } // get block size in bytes - uint64_t blk_size = core_storage->get_db().get_block_size(_blk_height); + uint64_t blk_size = core_storage->get_db().get_block_weight(_blk_height); // miner reward tx transaction coinbase_tx = blk.miner_tx; @@ -4293,7 +4293,7 @@ public: // get block size in bytes - uint64_t blk_size = core_storage->get_db().get_block_size(block_height); + uint64_t blk_size = core_storage->get_db().get_block_weight(block_height); // miner reward tx transaction coinbase_tx = blk.miner_tx; @@ -4522,7 +4522,7 @@ public: } // get block size in bytes - double blk_size = core_storage->get_db().get_block_size(i); + double blk_size = core_storage->get_db().get_block_weight(i); crypto::hash blk_hash = core_storage->get_block_id_by_height(i); @@ -4541,8 +4541,8 @@ public: json& j_txs = j_blocks.back()["txs"]; - list blk_txs {blk.miner_tx}; - list missed_txs; + vector blk_txs {blk.miner_tx}; + vector missed_txs; if (!core_storage->get_transactions(blk.tx_hashes, blk_txs, missed_txs)) { @@ -5107,8 +5107,8 @@ public: } // get transactions in the given block - list blk_txs{blk.miner_tx}; - list missed_txs; + vector blk_txs{blk.miner_tx}; + vector missed_txs; if (!core_storage->get_transactions(blk.tx_hashes, blk_txs, missed_txs)) { diff --git a/src/rpccalls.cpp b/src/rpccalls.cpp index d9711be..c5ec95f 100644 --- a/src/rpccalls.cpp +++ b/src/rpccalls.cpp @@ -275,9 +275,9 @@ rpccalls::get_dynamic_per_kb_fee_estimate( uint64_t& fee, string& error_msg) { - epee::json_rpc::request + epee::json_rpc::request req_t = AUTO_VAL_INIT(req_t); - epee::json_rpc::response + epee::json_rpc::response resp_t = AUTO_VAL_INIT(resp_t); diff --git a/src/tools.cpp b/src/tools.cpp index f5d6d30..9159ff8 100644 --- a/src/tools.cpp +++ b/src/tools.cpp @@ -935,7 +935,7 @@ decode_ringct(rct::rctSig const& rv, switch (rv.type) { case rct::RCTTypeSimple: - case rct::RCTTypeSimpleBulletproof: + case rct::RCTTypeBulletproof: amount = rct::decodeRctSimple(rv, rct::sk2rct(scalar1), i, @@ -943,7 +943,6 @@ decode_ringct(rct::rctSig const& rv, hw::get_device("default")); break; case rct::RCTTypeFull: - case rct::RCTTypeFullBulletproof: amount = rct::decodeRct(rv, rct::sk2rct(scalar1), i, @@ -1048,7 +1047,7 @@ decrypt(const std::string &ciphertext, } crypto::chacha_key key; - crypto::generate_chacha_key(&skey, sizeof(skey), key); + crypto::generate_chacha_key(&skey, sizeof(skey), key, 1); const crypto::chacha_iv &iv = *(const crypto::chacha_iv*)&ciphertext[0];