aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/crypto/slow-hash.c10
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp2
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl13
-rw-r--r--src/wallet/wallet_args.cpp19
4 files changed, 36 insertions, 8 deletions
diff --git a/src/crypto/slow-hash.c b/src/crypto/slow-hash.c
index 385808c0e..dca58195b 100644
--- a/src/crypto/slow-hash.c
+++ b/src/crypto/slow-hash.c
@@ -494,7 +494,7 @@ void slow_hash_free_state(void)
* buffer of pseudorandom data by hashing the supplied data. It then uses this
* random data to fill a large 2MB buffer with pseudorandom data by iteratively
* encrypting it using 10 rounds of AES per entry. After this initialization,
- * it executes 500,000 rounds of mixing through the random 2MB buffer using
+ * it executes 524,288 rounds of mixing through the random 2MB buffer using
* AES (typically provided in hardware on modern CPUs) and a 64 bit multiply.
* Finally, it re-mixes this large buffer back into
* the 200 byte "text" buffer, and then hashes this buffer using one of four
@@ -578,8 +578,8 @@ void cn_slow_hash(const void *data, size_t length, char *hash)
U64(b)[0] = U64(&state.k[16])[0] ^ U64(&state.k[48])[0];
U64(b)[1] = U64(&state.k[16])[1] ^ U64(&state.k[48])[1];
- /* CryptoNight Step 3: Bounce randomly 1 million times through the mixing buffer,
- * using 500,000 iterations of the following mixing function. Each execution
+ /* CryptoNight Step 3: Bounce randomly 1,048,576 times (1<<20) through the mixing buffer,
+ * using 524,288 iterations of the following mixing function. Each execution
* performs two reads and writes from the mixing buffer.
*/
@@ -895,8 +895,8 @@ void cn_slow_hash(const void *data, size_t length, char *hash)
U64(b)[0] = U64(&state.k[16])[0] ^ U64(&state.k[48])[0];
U64(b)[1] = U64(&state.k[16])[1] ^ U64(&state.k[48])[1];
- /* CryptoNight Step 3: Bounce randomly 1 million times through the mixing buffer,
- * using 500,000 iterations of the following mixing function. Each execution
+ /* CryptoNight Step 3: Bounce randomly 1,048,576 times (1<<20) through the mixing buffer,
+ * using 524,288 iterations of the following mixing function. Each execution
* performs two reads and writes from the mixing buffer.
*/
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 9c5fae4ef..d53cacd8e 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -796,7 +796,7 @@ namespace cryptonote
{
// we attempt to relay txes that should be relayed, but were not
std::list<std::pair<crypto::hash, cryptonote::transaction>> txs;
- if (m_mempool.get_relayable_transactions(txs))
+ if (m_mempool.get_relayable_transactions(txs) && !txs.empty())
{
cryptonote_connection_context fake_context = AUTO_VAL_INIT(fake_context);
tx_verification_context tvc = AUTO_VAL_INIT(tvc);
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index f007a83a8..79578a34e 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -548,7 +548,16 @@ namespace cryptonote
tx_ids.push_back(tx_hash);
if (m_core.get_transactions(tx_ids, txes, missing) && missing.empty())
{
- have_tx.push_back(tx_to_blob(tx));
+ if (txes.size() == 1)
+ {
+ have_tx.push_back(tx_to_blob(txes.front()));
+ }
+ else
+ {
+ MERROR("1 tx requested, none not found, but " << txes.size() << " returned");
+ m_core.resume_mine();
+ return 1;
+ }
}
else
{
@@ -605,7 +614,7 @@ namespace cryptonote
NOTIFY_NEW_BLOCK::request reg_arg = AUTO_VAL_INIT(reg_arg);
reg_arg.hop = arg.hop;
reg_arg.current_blockchain_height = arg.current_blockchain_height;
- reg_arg.b.block = b.block;
+ reg_arg.b = b;
relay_block(reg_arg, context);
}
else if( bvc.m_marked_as_orphaned )
diff --git a/src/wallet/wallet_args.cpp b/src/wallet/wallet_args.cpp
index 166ce57e7..1508f3791 100644
--- a/src/wallet/wallet_args.cpp
+++ b/src/wallet/wallet_args.cpp
@@ -86,6 +86,7 @@ namespace wallet_args
const command_line::arg_descriptor<std::string> arg_log_level = {"log-level", "0-4 or categories", ""};
const command_line::arg_descriptor<uint32_t> arg_max_concurrency = {"max-concurrency", wallet_args::tr("Max number of threads to use for a parallel job"), DEFAULT_MAX_CONCURRENCY};
const command_line::arg_descriptor<std::string> arg_log_file = {"log-file", wallet_args::tr("Specify log file"), ""};
+ const command_line::arg_descriptor<std::string> arg_config_file = {"config-file", wallet_args::tr("Config file"), "", true};
std::string lang = i18n_get_language();
@@ -101,6 +102,7 @@ namespace wallet_args
command_line::add_arg(desc_params, arg_log_file, "");
command_line::add_arg(desc_params, arg_log_level);
command_line::add_arg(desc_params, arg_max_concurrency);
+ command_line::add_arg(desc_params, arg_config_file);
i18n_set_language("translations", "monero", lang);
@@ -111,6 +113,23 @@ namespace wallet_args
{
auto parser = po::command_line_parser(argc, argv).options(desc_all).positional(positional_options);
po::store(parser.run(), vm);
+
+ if(command_line::has_arg(vm, arg_config_file))
+ {
+ std::string config = command_line::get_arg(vm, arg_config_file);
+ bf::path config_path(config);
+ boost::system::error_code ec;
+ if (bf::exists(config_path, ec))
+ {
+ po::store(po::parse_config_file<char>(config_path.string<std::string>().c_str(), desc_params), vm);
+ }
+ else
+ {
+ tools::fail_msg_writer() << wallet_args::tr("Can't find config file ") << config;
+ return false;
+ }
+ }
+
po::notify(vm);
return true;
});