aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/blockchain.cpp159
-rw-r--r--src/cryptonote_core/blockchain.h11
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp31
-rw-r--r--src/cryptonote_core/cryptonote_core.h12
-rw-r--r--src/cryptonote_core/cryptonote_tx_utils.cpp6
-rw-r--r--src/cryptonote_core/cryptonote_tx_utils.h6
-rw-r--r--src/cryptonote_core/tx_pool.cpp2
7 files changed, 162 insertions, 65 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index bfc5dbbe0..c6a3c6180 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -44,7 +44,7 @@
#include "misc_language.h"
#include "profile_tools.h"
#include "file_io_utils.h"
-#include "common/int-util.h"
+#include "int-util.h"
#include "common/threadpool.h"
#include "common/boost_serialization_helper.h"
#include "warnings.h"
@@ -404,7 +404,7 @@ bool Blockchain::init(BlockchainDB* db, const network_type nettype, bool offline
if(!m_db->height())
{
MINFO("Blockchain not loaded, generating genesis block.");
- block bl = boost::value_initialized<block>();
+ block bl;
block_verification_context bvc = boost::value_initialized<block_verification_context>();
generate_genesis_block(bl, get_config(m_nettype).GENESIS_TX, get_config(m_nettype).GENESIS_NONCE);
add_new_block(bl, bvc);
@@ -576,6 +576,38 @@ bool Blockchain::deinit()
return true;
}
//------------------------------------------------------------------
+// This function removes blocks from the top of blockchain.
+// It starts a batch and calls private method pop_block_from_blockchain().
+void Blockchain::pop_blocks(uint64_t nblocks)
+{
+ uint64_t i;
+ CRITICAL_REGION_LOCAL(m_tx_pool);
+ CRITICAL_REGION_LOCAL1(m_blockchain_lock);
+
+ while (!m_db->batch_start())
+ {
+ m_blockchain_lock.unlock();
+ m_tx_pool.unlock();
+ epee::misc_utils::sleep_no_w(1000);
+ m_tx_pool.lock();
+ m_blockchain_lock.lock();
+ }
+
+ try
+ {
+ for (i=0; i < nblocks; ++i)
+ {
+ pop_block_from_blockchain();
+ }
+ }
+ catch (const std::exception& e)
+ {
+ LOG_ERROR("Error when popping blocks, only " << i << " blocks are popped: " << e.what());
+ }
+
+ m_db->batch_stop();
+}
+//------------------------------------------------------------------
// This function tells BlockchainDB to remove the top block from the
// blockchain and then returns all transactions (except the miner tx, of course)
// from it to the tx_pool
@@ -929,7 +961,7 @@ bool Blockchain::rollback_blockchain_switching(std::list<block>& original_chain,
m_hardfork->reorganize_from_chain_height(rollback_height);
MINFO("Rollback to height " << rollback_height << " was successful.");
- if (original_chain.size())
+ if (!original_chain.empty())
{
MINFO("Restoration to previous blockchain successful as well.");
}
@@ -1484,7 +1516,7 @@ bool Blockchain::handle_alternative_block(const block& b, const crypto::hash& id
// if block to be added connects to known blocks that aren't part of the
// main chain -- that is, if we're adding on to an alternate chain
- if(alt_chain.size())
+ if(!alt_chain.empty())
{
// make sure alt chain doesn't somehow start past the end of the main chain
CHECK_AND_ASSERT_MES(m_db->height() > alt_chain.front()->second.height, false, "main blockchain wrong height");
@@ -1875,7 +1907,7 @@ bool Blockchain::find_blockchain_supplement(const std::list<crypto::hash>& qbloc
// make sure the request includes at least the genesis block, otherwise
// how can we expect to sync from the client that the block list came from?
- if(!qblock_ids.size())
+ if(qblock_ids.empty())
{
MCERROR("net.p2p", "Client sent wrong NOTIFY_REQUEST_CHAIN: m_block_ids.size()=" << qblock_ids.size() << ", dropping connection");
return false;
@@ -3723,7 +3755,7 @@ void Blockchain::set_enforce_dns_checkpoints(bool enforce_checkpoints)
}
//------------------------------------------------------------------
-void Blockchain::block_longhash_worker(uint64_t height, const std::vector<block> &blocks, std::unordered_map<crypto::hash, crypto::hash> &map) const
+void Blockchain::block_longhash_worker(uint64_t height, const epee::span<const block> &blocks, std::unordered_map<crypto::hash, crypto::hash> &map) const
{
TIME_MEASURE_START(t);
slow_hash_allocate_state();
@@ -3809,11 +3841,33 @@ bool Blockchain::cleanup_handle_incoming_blocks(bool force_sync)
}
//------------------------------------------------------------------
-void Blockchain::output_scan_worker(const uint64_t amount, const std::vector<uint64_t> &offsets, std::vector<output_data_t> &outputs) const
+void Blockchain::output_scan_worker(const uint64_t amount, const std::vector<uint64_t> &offsets, std::vector<output_data_t> &outputs, const std::vector<output_data_t> &extra_tx_map) const
{
try
{
m_db->get_output_key(epee::span<const uint64_t>(&amount, 1), offsets, outputs, true);
+ if (outputs.size() < offsets.size())
+ {
+ const uint64_t n_outputs = m_db->get_num_outputs(amount);
+ for (size_t i = outputs.size(); i < offsets.size(); ++i)
+ {
+ uint64_t idx = offsets[i];
+ if (idx < n_outputs)
+ {
+ MWARNING("Index " << idx << " not found in db for amount " << amount << ", but it is less than the number of entries");
+ break;
+ }
+ else if (idx < n_outputs + extra_tx_map.size())
+ {
+ outputs.push_back(extra_tx_map[idx - n_outputs]);
+ }
+ else
+ {
+ MWARNING("missed " << amount << "/" << idx << " in " << extra_tx_map.size() << " (chain " << n_outputs << ")");
+ break;
+ }
+ }
+ }
}
catch (const std::exception& e)
{
@@ -3928,6 +3982,34 @@ uint64_t Blockchain::prevalidate_block_hashes(uint64_t height, const std::vector
// vs [k_image, output_keys] (m_scan_table). This is faster because it takes advantage of bulk queries
// and is threaded if possible. The table (m_scan_table) will be used later when querying output
// keys.
+static bool update_output_map(std::map<uint64_t, std::vector<output_data_t>> &extra_tx_map, const transaction &tx, uint64_t height, bool miner)
+{
+ MTRACE("Blockchain::" << __func__);
+ for (size_t i = 0; i < tx.vout.size(); ++i)
+ {
+ const auto &out = tx.vout[i];
+ if (out.target.type() != typeid(txout_to_key))
+ continue;
+ const txout_to_key &out_to_key = boost::get<txout_to_key>(out.target);
+ rct::key commitment;
+ uint64_t amount = out.amount;
+ if (miner && tx.version == 2)
+ {
+ commitment = rct::zeroCommit(amount);
+ amount = 0;
+ }
+ else if (tx.version > 1)
+ {
+ CHECK_AND_ASSERT_MES(i < tx.rct_signatures.outPk.size(), false, "Invalid outPk size");
+ commitment = tx.rct_signatures.outPk[i].mask;
+ }
+ else
+ commitment = rct::zero();
+ extra_tx_map[amount].push_back(output_data_t{out_to_key.key, tx.unlock_time, height, commitment});
+ }
+ return true;
+}
+
bool Blockchain::prepare_handle_incoming_blocks(const std::vector<block_complete_entry> &blocks_entry)
{
MTRACE("Blockchain::" << __func__);
@@ -3974,42 +4056,40 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::vector<block_complete
m_blockchain_lock.lock();
}
- if ((m_db->height() + blocks_entry.size()) < m_blocks_hash_check.size())
+ const uint64_t height = m_db->height();
+ if ((height + blocks_entry.size()) < m_blocks_hash_check.size())
return true;
bool blocks_exist = false;
tools::threadpool& tpool = tools::threadpool::getInstance();
- uint64_t threads = tpool.get_max_concurrency();
+ unsigned threads = tpool.get_max_concurrency();
+ std::vector<block> blocks;
+ blocks.resize(blocks_entry.size());
- if (blocks_entry.size() > 1 && threads > 1 && m_max_prepare_blocks_threads > 1)
+ if (1)
{
// limit threads, default limit = 4
if(threads > m_max_prepare_blocks_threads)
threads = m_max_prepare_blocks_threads;
- uint64_t height = m_db->height();
- int batches = blocks_entry.size() / threads;
- int extra = blocks_entry.size() % threads;
+ unsigned int batches = blocks_entry.size() / threads;
+ unsigned int extra = blocks_entry.size() % threads;
MDEBUG("block_batches: " << batches);
std::vector<std::unordered_map<crypto::hash, crypto::hash>> maps(threads);
- std::vector < std::vector < block >> blocks(threads);
auto it = blocks_entry.begin();
+ unsigned blockidx = 0;
- for (uint64_t i = 0; i < threads; i++)
+ for (unsigned i = 0; i < threads; i++)
{
- blocks[i].reserve(batches + 1);
- for (int j = 0; j < batches; j++)
+ for (unsigned int j = 0; j < batches; j++, ++blockidx)
{
- block block;
+ block &block = blocks[blockidx];
if (!parse_and_validate_block_from_blob(it->block, block))
- {
- std::advance(it, 1);
- continue;
- }
+ return false;
// check first block and skip all blocks if its not chained properly
- if (i == 0 && j == 0)
+ if (blockidx == 0)
{
crypto::hash tophash = m_db->top_block_hash();
if (block.prev_id != tophash)
@@ -4024,20 +4104,16 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::vector<block_complete
break;
}
- blocks[i].push_back(std::move(block));
std::advance(it, 1);
}
}
- for (int i = 0; i < extra && !blocks_exist; i++)
+ for (unsigned i = 0; i < extra && !blocks_exist; i++, blockidx++)
{
- block block;
+ block &block = blocks[blockidx];
if (!parse_and_validate_block_from_blob(it->block, block))
- {
- std::advance(it, 1);
- continue;
- }
+ return false;
if (have_block(get_block_hash(block)))
{
@@ -4045,7 +4121,6 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::vector<block_complete
break;
}
- blocks[i].push_back(std::move(block));
std::advance(it, 1);
}
@@ -4054,10 +4129,13 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::vector<block_complete
m_blocks_longhash_table.clear();
uint64_t thread_height = height;
tools::threadpool::waiter waiter;
- for (uint64_t i = 0; i < threads; i++)
+ for (unsigned int i = 0; i < threads; i++)
{
- tpool.submit(&waiter, boost::bind(&Blockchain::block_longhash_worker, this, thread_height, std::cref(blocks[i]), std::ref(maps[i])), true);
- thread_height += blocks[i].size();
+ unsigned nblocks = batches;
+ if (i < extra)
+ ++nblocks;
+ tpool.submit(&waiter, boost::bind(&Blockchain::block_longhash_worker, this, thread_height, epee::span<const block>(&blocks[i], nblocks), std::ref(maps[i])), true);
+ thread_height += nblocks;
}
waiter.wait(&tpool);
@@ -4100,7 +4178,7 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::vector<block_complete
// [input] stores all absolute_offsets for each amount
std::map<uint64_t, std::vector<uint64_t>> offset_map;
// [output] stores all output_data_t for each absolute_offset
- std::map<uint64_t, std::vector<output_data_t>> tx_map;
+ std::map<uint64_t, std::vector<output_data_t>> tx_map, extra_tx_map;
std::vector<std::pair<cryptonote::transaction, crypto::hash>> txes(total_txs);
#define SCAN_TABLE_QUIT(m) \
@@ -4111,12 +4189,14 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::vector<block_complete
} while(0); \
// generate sorted tables for all amounts and absolute offsets
- size_t tx_index = 0;
+ size_t tx_index = 0, block_index = 0;
for (const auto &entry : blocks_entry)
{
if (m_cancel)
return false;
+ if (!update_output_map(extra_tx_map, blocks[block_index].miner_tx, height + block_index, true))
+ SCAN_TABLE_QUIT("Error building extra tx map.");
for (const auto &tx_blob : entry.txs)
{
if (tx_index >= txes.size())
@@ -4175,7 +4255,10 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::vector<block_complete
offset_map[in_to_key.amount].push_back(offset);
}
+ if (!update_output_map(extra_tx_map, tx, height + block_index, false))
+ SCAN_TABLE_QUIT("Error building extra tx map.");
}
+ ++block_index;
}
// sort and remove duplicate absolute_offsets in offset_map
@@ -4198,7 +4281,7 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::vector<block_complete
for (size_t i = 0; i < amounts.size(); i++)
{
uint64_t amount = amounts[i];
- tpool.submit(&waiter, boost::bind(&Blockchain::output_scan_worker, this, amount, std::cref(offset_map[amount]), std::ref(tx_map[amount])), true);
+ tpool.submit(&waiter, boost::bind(&Blockchain::output_scan_worker, this, amount, std::cref(offset_map[amount]), std::ref(tx_map[amount]), std::cref(extra_tx_map[amount])), true);
}
waiter.wait(&tpool);
}
@@ -4207,7 +4290,7 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::vector<block_complete
for (size_t i = 0; i < amounts.size(); i++)
{
uint64_t amount = amounts[i];
- output_scan_worker(amount, offset_map[amount], tx_map[amount]);
+ output_scan_worker(amount, offset_map[amount], tx_map[amount], extra_tx_map[amount]);
}
}
diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h
index dfe833fb4..877828f81 100644
--- a/src/cryptonote_core/blockchain.h
+++ b/src/cryptonote_core/blockchain.h
@@ -918,7 +918,7 @@ namespace cryptonote
* @param outputs return-by-reference the outputs collected
*/
void output_scan_worker(const uint64_t amount,const std::vector<uint64_t> &offsets,
- std::vector<output_data_t> &outputs) const;
+ std::vector<output_data_t> &outputs, const std::vector<output_data_t> &extra_tx_map) const;
/**
* @brief computes the "short" and "long" hashes for a set of blocks
@@ -927,7 +927,7 @@ namespace cryptonote
* @param blocks the blocks to be hashed
* @param map return-by-reference the hashes for each block
*/
- void block_longhash_worker(uint64_t height, const std::vector<block> &blocks,
+ void block_longhash_worker(uint64_t height, const epee::span<const block> &blocks,
std::unordered_map<crypto::hash, crypto::hash> &map) const;
/**
@@ -967,6 +967,13 @@ namespace cryptonote
*/
std::vector<time_t> get_last_block_timestamps(unsigned int blocks) const;
+ /**
+ * @brief removes blocks from the top of the blockchain
+ *
+ * @param nblocks number of blocks to be removed
+ */
+ void pop_blocks(uint64_t nblocks);
+
private:
// TODO: evaluate whether or not each of these typedefs are left over from blockchain_storage
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 10ab3fe65..f3249ea92 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -30,13 +30,11 @@
#include <boost/algorithm/string.hpp>
-#include "include_base_utils.h"
#include "string_tools.h"
using namespace epee;
#include <unordered_set>
#include "cryptonote_core.h"
-#include "common/command_line.h"
#include "common/util.h"
#include "common/updates.h"
#include "common/download.h"
@@ -45,7 +43,6 @@ using namespace epee;
#include "warnings.h"
#include "crypto/crypto.h"
#include "cryptonote_config.h"
-#include "cryptonote_tx_utils.h"
#include "misc_language.h"
#include "file_io_utils.h"
#include <csignal>
@@ -163,6 +160,11 @@ namespace cryptonote
, "Relay blocks as normal blocks"
, false
};
+ static const command_line::arg_descriptor<bool> arg_pad_transactions = {
+ "pad-transactions"
+ , "Pad relayed transactions to help defend against traffic volume analysis"
+ , false
+ };
static const command_line::arg_descriptor<size_t> arg_max_txpool_weight = {
"max-txpool-weight"
, "Set maximum txpool weight in bytes."
@@ -188,7 +190,8 @@ namespace cryptonote
m_disable_dns_checkpoints(false),
m_update_download(0),
m_nettype(UNDEFINED),
- m_update_available(false)
+ m_update_available(false),
+ m_pad_transactions(false)
{
m_checkpoints_updating.clear();
set_cryptonote_protocol(pprotocol);
@@ -247,6 +250,7 @@ namespace cryptonote
//-----------------------------------------------------------------------------------
void core::stop()
{
+ m_miner.stop();
m_blockchain_storage.cancel();
tools::download_async_handle handle;
@@ -282,6 +286,7 @@ namespace cryptonote
command_line::add_arg(desc, arg_offline);
command_line::add_arg(desc, arg_disable_dns_checkpoints);
command_line::add_arg(desc, arg_max_txpool_weight);
+ command_line::add_arg(desc, arg_pad_transactions);
command_line::add_arg(desc, arg_block_notify);
miner::init_options(desc);
@@ -320,6 +325,7 @@ namespace cryptonote
set_enforce_dns_checkpoints(command_line::get_arg(vm, arg_dns_checkpoints));
test_drop_download_height(command_line::get_arg(vm, arg_test_drop_download_height));
m_fluffy_blocks_enabled = !get_arg(vm, arg_no_fluffy_blocks);
+ m_pad_transactions = get_arg(vm, arg_pad_transactions);
m_offline = get_arg(vm, arg_offline);
m_disable_dns_checkpoints = get_arg(vm, arg_disable_dns_checkpoints);
if (!command_line::is_arg_defaulted(vm, arg_fluffy_blocks))
@@ -389,7 +395,7 @@ namespace cryptonote
return m_blockchain_storage.get_alternative_blocks_count();
}
//-----------------------------------------------------------------------------------------------
- bool core::init(const boost::program_options::variables_map& vm, const char *config_subdir, const cryptonote::test_options *test_options, const GetCheckpointsCallback& get_checkpoints/* = nullptr */)
+ bool core::init(const boost::program_options::variables_map& vm, const cryptonote::test_options *test_options, const GetCheckpointsCallback& get_checkpoints/* = nullptr */)
{
start_time = std::time(nullptr);
@@ -399,10 +405,6 @@ namespace cryptonote
m_nettype = FAKECHAIN;
}
bool r = handle_command_line(vm);
- std::string m_config_folder_mempool = m_config_folder;
-
- if (config_subdir)
- m_config_folder_mempool = m_config_folder_mempool + "/" + config_subdir;
std::string db_type = command_line::get_arg(vm, cryptonote::arg_db_type);
std::string db_sync_mode = command_line::get_arg(vm, cryptonote::arg_db_sync_mode);
@@ -834,7 +836,7 @@ namespace cryptonote
TRY_ENTRY();
CRITICAL_REGION_LOCAL(m_incoming_tx_lock);
- struct result { bool res; cryptonote::transaction tx; crypto::hash hash; crypto::hash prefix_hash; bool in_txpool; bool in_blockchain; };
+ struct result { bool res; cryptonote::transaction tx; crypto::hash hash; crypto::hash prefix_hash; };
std::vector<result> results(tx_blobs.size());
tvc.resize(tx_blobs.size());
@@ -900,13 +902,15 @@ namespace cryptonote
bool ok = true;
it = tx_blobs.begin();
for (size_t i = 0; i < tx_blobs.size(); i++, ++it) {
- if (already_have[i])
- continue;
if (!results[i].res)
{
ok = false;
continue;
}
+ if (keeped_by_block)
+ get_blockchain_storage().on_new_tx_from_block(results[i].tx);
+ if (already_have[i])
+ continue;
const size_t weight = get_transaction_weight(results[i].tx, it->size());
ok &= add_new_tx(results[i].tx, results[i].hash, tx_blobs[i], results[i].prefix_hash, weight, tvc[i], keeped_by_block, relayed, do_not_relay);
@@ -1137,9 +1141,6 @@ namespace cryptonote
//-----------------------------------------------------------------------------------------------
bool core::add_new_tx(transaction& tx, const crypto::hash& tx_hash, const cryptonote::blobdata &blob, const crypto::hash& tx_prefix_hash, size_t tx_weight, tx_verification_context& tvc, bool keeped_by_block, bool relayed, bool do_not_relay)
{
- if (keeped_by_block)
- get_blockchain_storage().on_new_tx_from_block(tx);
-
if(m_mempool.have_tx(tx_hash))
{
LOG_PRINT_L2("tx " << tx_hash << "already have transaction in tx_pool");
diff --git a/src/cryptonote_core/cryptonote_core.h b/src/cryptonote_core/cryptonote_core.h
index 2eb6c842b..cc53fce58 100644
--- a/src/cryptonote_core/cryptonote_core.h
+++ b/src/cryptonote_core/cryptonote_core.h
@@ -34,7 +34,6 @@
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/variables_map.hpp>
-#include <boost/interprocess/sync/file_lock.hpp>
#include "cryptonote_protocol/cryptonote_protocol_handler_common.h"
#include "storages/portable_storage_template_helper.h"
@@ -242,13 +241,12 @@ namespace cryptonote
* a miner instance with parameters given on the command line (or defaults)
*
* @param vm command line parameters
- * @param config_subdir subdirectory for config storage
* @param test_options configuration options for testing
* @param get_checkpoints if set, will be called to get checkpoints data, must return checkpoints data pointer and size or nullptr if there ain't any checkpoints for specific network type
*
* @return false if one of the init steps fails, otherwise true
*/
- bool init(const boost::program_options::variables_map& vm, const char *config_subdir = NULL, const test_options *test_options = NULL, const GetCheckpointsCallback& get_checkpoints = nullptr);
+ bool init(const boost::program_options::variables_map& vm, const test_options *test_options = NULL, const GetCheckpointsCallback& get_checkpoints = nullptr);
/**
* @copydoc Blockchain::reset_and_set_genesis_block
@@ -757,6 +755,13 @@ namespace cryptonote
bool fluffy_blocks_enabled() const { return m_fluffy_blocks_enabled; }
/**
+ * @brief get whether transaction relay should be padded
+ *
+ * @return whether transaction relay should be padded
+ */
+ bool pad_transactions() const { return m_pad_transactions; }
+
+ /**
* @brief check a set of hashes against the precompiled hash set
*
* @return number of usable blocks
@@ -1015,6 +1020,7 @@ namespace cryptonote
bool m_fluffy_blocks_enabled;
bool m_offline;
+ bool m_pad_transactions;
};
}
diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp
index 4fc2736a6..f443d638c 100644
--- a/src/cryptonote_core/cryptonote_tx_utils.cpp
+++ b/src/cryptonote_core/cryptonote_tx_utils.cpp
@@ -198,7 +198,7 @@ namespace cryptonote
return addr.m_view_public_key;
}
//---------------------------------------------------------------
- bool construct_tx_with_tx_key(const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, std::vector<tx_destination_entry>& destinations, const boost::optional<cryptonote::account_public_address>& change_addr, std::vector<uint8_t> extra, transaction& tx, uint64_t unlock_time, const crypto::secret_key &tx_key, const std::vector<crypto::secret_key> &additional_tx_keys, bool rct, rct::RangeProofType range_proof_type, rct::multisig_out *msout, bool shuffle_outs)
+ bool construct_tx_with_tx_key(const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, std::vector<tx_destination_entry>& destinations, const boost::optional<cryptonote::account_public_address>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time, const crypto::secret_key &tx_key, const std::vector<crypto::secret_key> &additional_tx_keys, bool rct, rct::RangeProofType range_proof_type, rct::multisig_out *msout, bool shuffle_outs)
{
hw::device &hwdev = sender_account_keys.get_device();
@@ -610,7 +610,7 @@ namespace cryptonote
return true;
}
//---------------------------------------------------------------
- bool construct_tx_and_get_tx_key(const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, std::vector<tx_destination_entry>& destinations, const boost::optional<cryptonote::account_public_address>& change_addr, std::vector<uint8_t> extra, transaction& tx, uint64_t unlock_time, crypto::secret_key &tx_key, std::vector<crypto::secret_key> &additional_tx_keys, bool rct, rct::RangeProofType range_proof_type, rct::multisig_out *msout)
+ bool construct_tx_and_get_tx_key(const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, std::vector<tx_destination_entry>& destinations, const boost::optional<cryptonote::account_public_address>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time, crypto::secret_key &tx_key, std::vector<crypto::secret_key> &additional_tx_keys, bool rct, rct::RangeProofType range_proof_type, rct::multisig_out *msout)
{
hw::device &hwdev = sender_account_keys.get_device();
hwdev.open_tx(tx_key);
@@ -633,7 +633,7 @@ namespace cryptonote
return r;
}
//---------------------------------------------------------------
- bool construct_tx(const account_keys& sender_account_keys, std::vector<tx_source_entry>& sources, const std::vector<tx_destination_entry>& destinations, const boost::optional<cryptonote::account_public_address>& change_addr, std::vector<uint8_t> extra, transaction& tx, uint64_t unlock_time)
+ bool construct_tx(const account_keys& sender_account_keys, std::vector<tx_source_entry>& sources, const std::vector<tx_destination_entry>& destinations, const boost::optional<cryptonote::account_public_address>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time)
{
std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
subaddresses[sender_account_keys.m_account_address.m_spend_public_key] = {0,0};
diff --git a/src/cryptonote_core/cryptonote_tx_utils.h b/src/cryptonote_core/cryptonote_tx_utils.h
index f2cf7b6ca..87edafe9d 100644
--- a/src/cryptonote_core/cryptonote_tx_utils.h
+++ b/src/cryptonote_core/cryptonote_tx_utils.h
@@ -89,9 +89,9 @@ namespace cryptonote
//---------------------------------------------------------------
crypto::public_key get_destination_view_key_pub(const std::vector<tx_destination_entry> &destinations, const boost::optional<cryptonote::account_public_address>& change_addr);
- bool construct_tx(const account_keys& sender_account_keys, std::vector<tx_source_entry> &sources, const std::vector<tx_destination_entry>& destinations, const boost::optional<cryptonote::account_public_address>& change_addr, std::vector<uint8_t> extra, transaction& tx, uint64_t unlock_time);
- bool construct_tx_with_tx_key(const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, std::vector<tx_destination_entry>& destinations, const boost::optional<cryptonote::account_public_address>& change_addr, std::vector<uint8_t> extra, transaction& tx, uint64_t unlock_time, const crypto::secret_key &tx_key, const std::vector<crypto::secret_key> &additional_tx_keys, bool rct = false, rct::RangeProofType range_proof_type = rct::RangeProofBorromean, rct::multisig_out *msout = NULL, bool shuffle_outs = true);
- bool construct_tx_and_get_tx_key(const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, std::vector<tx_destination_entry>& destinations, const boost::optional<cryptonote::account_public_address>& change_addr, std::vector<uint8_t> extra, transaction& tx, uint64_t unlock_time, crypto::secret_key &tx_key, std::vector<crypto::secret_key> &additional_tx_keys, bool rct = false, rct::RangeProofType range_proof_type = rct::RangeProofBorromean, rct::multisig_out *msout = NULL);
+ bool construct_tx(const account_keys& sender_account_keys, std::vector<tx_source_entry> &sources, const std::vector<tx_destination_entry>& destinations, const boost::optional<cryptonote::account_public_address>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time);
+ bool construct_tx_with_tx_key(const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, std::vector<tx_destination_entry>& destinations, const boost::optional<cryptonote::account_public_address>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time, const crypto::secret_key &tx_key, const std::vector<crypto::secret_key> &additional_tx_keys, bool rct = false, rct::RangeProofType range_proof_type = rct::RangeProofBorromean, rct::multisig_out *msout = NULL, bool shuffle_outs = true);
+ bool construct_tx_and_get_tx_key(const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, std::vector<tx_destination_entry>& destinations, const boost::optional<cryptonote::account_public_address>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time, crypto::secret_key &tx_key, std::vector<crypto::secret_key> &additional_tx_keys, bool rct = false, rct::RangeProofType range_proof_type = rct::RangeProofBorromean, rct::multisig_out *msout = NULL);
bool generate_genesis_block(
block& bl
diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp
index e2900916b..d4b4e4d34 100644
--- a/src/cryptonote_core/tx_pool.cpp
+++ b/src/cryptonote_core/tx_pool.cpp
@@ -40,7 +40,7 @@
#include "blockchain.h"
#include "blockchain_db/blockchain_db.h"
#include "common/boost_serialization_helper.h"
-#include "common/int-util.h"
+#include "int-util.h"
#include "misc_language.h"
#include "warnings.h"
#include "common/perf_timer.h"