forked from such-gitea/wownero
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2d2b9a447 | ||
|
|
f897aa5dbf | ||
|
|
5b162aea14 | ||
|
|
3b13340a30 | ||
|
|
84674fd19d | ||
|
|
f4cea65949 | ||
|
|
2c07a2d5c7 | ||
|
|
8d0e98ac58 | ||
|
|
a5f901b46f | ||
|
|
f65197d73e | ||
|
|
222aba8ccf | ||
|
|
963d748f34 | ||
|
|
cfadfbd91a | ||
|
|
a67fc7e638 | ||
|
|
0e65b21328 | ||
|
|
d886300416 | ||
|
|
c3e390d44d | ||
|
|
f2f76de880 | ||
|
|
89f650cf52 | ||
|
|
6cfba57fb0 | ||
|
|
d45df91391 | ||
|
|
d95ab4b9e3 | ||
|
|
8fe9ce706c | ||
|
|
9522d66815 | ||
|
|
66f7ea2dbf | ||
|
|
7dff3540f0 | ||
|
|
4679168a57 | ||
|
|
fc745d7bc9 | ||
|
|
de01cb77d5 | ||
|
|
5d96c2c014 | ||
|
|
f17b506d3d | ||
|
|
2ec025d1a3 | ||
|
|
1212e1791c | ||
|
|
fea538fcda | ||
|
|
c1f0d43047 |
2
LICENSE
2
LICENSE
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2014-2020, The Monero Project
|
||||
Copyright (c) 2014-2021, The Monero Project
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
||||
34
README.md
34
README.md
@@ -1,43 +1,34 @@
|
||||
[](https://ci.wownero.com/wownero/wownero)
|
||||
# ~~Mo~~Wownero - Such privacy! Many coins! Wow! 🐕
|
||||
|
||||
Copyright (c) 2014-2020 The Monero Project.
|
||||
Copyright (c) 2014-2021 The Monero Project.
|
||||
Portions Copyright (c) 2012-2013 The Cryptonote developers.
|
||||
|
||||
## Resources
|
||||
|
||||
- Web: [wownero.org](http://wownero.org)
|
||||
- Web: [wownero.org](https://wownero.org)
|
||||
- Twitter: [@w0wn3r0](https://twitter.com/w0wn3r0)
|
||||
- Reddit: [/r/wownero](https://www.reddit.com/r/wownero)
|
||||
- Mail: [wownero@protonmail.com](mailto:wownero@protonmail.com)
|
||||
- GitHub: [git.wownero.com/wownero/wownero](https://git.wownero.com/wownero/wownero)
|
||||
- IRC: [#wownero on Freenode](https://kiwiirc.com/client/irc.freenode.net/?nick=suchchatter|?#wownero)
|
||||
- Bitmessage Chan: wownero (`BM-2cSzWtrj2pzLva9GF1Jp2TYsnLjrnJpvba`)
|
||||
- Git: [git.wownero.com/wownero/wownero](https://git.wownero.com/wownero/wownero)
|
||||
- Wownero Funding System: [funding.wownero.com](https://funding.wownero.com)
|
||||
- Wownero Forum: [forum.wownero.com](https://forum.wownero.com)
|
||||
- Discord: [discord.gg/DSC9TWx](https://discord.gg/DSC9TWx)
|
||||
- Discord: [discord.gg/ENbgme4bWq](https://discord.com/invite/ENbgme4bWq)
|
||||
- Telegram: [t.me/wownero](https://t.me/wownero)
|
||||
- Feather-WOW Desktop Wallet: [featherwallet.org/wownero](https://featherwallet.org/wownero)
|
||||
- WOW Stash Web Wallet: [wowstash.app](https://wowstash.app)
|
||||
- Public Node Status: [monero.fail](https://monero.fail/?crypto=wownero)
|
||||
- Map of Nodes: [wownero.fyi](https://wownero.fyi)
|
||||
- Wownero Memes: [suchwow.xyz]https://suchwow.xyz/posts/top)
|
||||
- XMR/WOW Swap: [nero Swap](https://neroswap.com)
|
||||
- Mining Pools: [miningpoolstats.stream](https://miningpoolstats.stream/wownero)
|
||||
- Market Info: [coinmarketcap.com](https://coinmarketcap.com/currencies/wownero), [coingecko.com](https://www.coingecko.com/en/coins/wownero/usd)
|
||||
|
||||
### Blockchain Explorers
|
||||
- https://explore.wownero.com
|
||||
- http://wow5eqtzqvsg5jctqzg5g7uk3u62sfqiacj5x6lo4by7bvnj6jkvubyd.onion
|
||||
- https://wownero.club
|
||||
|
||||
### Free Public Nodes
|
||||
- global.wownodes.com:34568 (Global)
|
||||
- node.suchwow.xyz:34568 (US)
|
||||
- wow.pwned.systems:34568 (NL)
|
||||
- wowbux.org:34568 (CA)
|
||||
- super.fast.node.xmr.pm:34568 (DE)
|
||||
- wow.pwned.systems (NL)
|
||||
- wowbuxx535x4exuexja2xfezpwcyznxkofui4ndjiectj4yuh2xheiid.onion:34568
|
||||
|
||||
### Tor Peers
|
||||
- wowp2p5gelm6vhl2d5tvfqills63jilgy6hkvlrqljooov5ktaxgqdad.onion
|
||||
- f3moshycuklu3mb3wnlfjwn26nsgzreqtfzfuyjjk46u7jqxlhf7d5id.onion
|
||||
- https://explorer.wownero.fyi
|
||||
|
||||
## Introduction
|
||||
|
||||
@@ -50,6 +41,9 @@ Wownero is a 100% community-sponsored endeavor. Supporting services are also gra
|
||||
[<img src="https://git.wownero.com/wownero/meta/raw/branch/master/images/macstadium.png"
|
||||
alt="MacStadium"
|
||||
height="100">](https://www.macstadium.com)
|
||||
[<img src="https://git.wownero.com/wownero/meta/raw/branch/master/images/jetbrains.png"
|
||||
alt="JetBrains"
|
||||
height="100">](https://www.jetbrains.com)
|
||||
|
||||
Developers are volunteers doing this mostly for shits and giggles. If you would like to support our shenanigans and stimulant addictions, please consider donating to [WFS proposals](https://funding.wownero.com/proposals) or the dev slush fund.
|
||||
|
||||
@@ -90,7 +84,7 @@ Dates are provided in the format YYYY-MM-DD.
|
||||
| 114,969 | 2019-06-14 | F For Fappening | v0.6.1.0 | v0.6.1.2 | RandomWOW, new block weight algorithm, slightly more efficient RingCT format
|
||||
| 160,777 | 2019-11-20 | Gaping Goatse | v0.7.0.0 | v0.7.1.0 | Only allow >= 2 outputs, change to the block median used to calculate penalty, rct sigs in coinbase forbidden, 4 unlock time as protocol rule
|
||||
| - | 2020-06-28 | Hallucinogenic Hypnotoad | v0.8.0.0 | v0.8.0.2 | Dandelion++ support
|
||||
| 253,999 | 2020-10-09 | Illiterate Illuminati | v0.9.0.0 | v0.9.2.1 | Dynamic coinbase unlock (up to 1 mo.), Deterministic unlock times, Enforce maximum coinbase amount, show_qr_code wallet command, CLSAG
|
||||
| 253,999 | 2020-10-09 | Illiterate Illuminati | v0.9.0.0 | v0.9.3.3 | Dynamic coinbase unlock (up to 1 mo.), Deterministic unlock times, Enforce maximum coinbase amount, show_qr_code wallet command, CLSAG
|
||||
|
||||
X's indicate that these details have not been determined as of commit date.
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <boost/thread/lock_guard.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
static bool same_as_last_line(const std::string&);
|
||||
static void install_line_handler();
|
||||
static void remove_line_handler();
|
||||
|
||||
@@ -175,8 +176,11 @@ static void handle_line(char* line)
|
||||
boost::trim_right(test_line);
|
||||
if(!test_line.empty())
|
||||
{
|
||||
add_history(test_line.c_str());
|
||||
history_set_pos(history_length);
|
||||
if (!same_as_last_line(test_line))
|
||||
{
|
||||
add_history(test_line.c_str());
|
||||
history_set_pos(history_length);
|
||||
}
|
||||
if (test_line == "exit" || test_line == "q")
|
||||
exit = true;
|
||||
}
|
||||
@@ -192,6 +196,16 @@ static void handle_line(char* line)
|
||||
return;
|
||||
}
|
||||
|
||||
// same_as_last_line returns true, if the last line in the history is
|
||||
// equal to test_line.
|
||||
static bool same_as_last_line(const std::string& test_line)
|
||||
{
|
||||
// Note that state->offset == state->length, when a new line was entered.
|
||||
HISTORY_STATE* state = history_get_history_state();
|
||||
return state->length > 0
|
||||
&& test_line.compare(state->entries[state->length-1]->line) == 0;
|
||||
}
|
||||
|
||||
static char* completion_matches(const char* text, int state)
|
||||
{
|
||||
static size_t list_index;
|
||||
|
||||
@@ -14,8 +14,8 @@ then
|
||||
exit 1
|
||||
fi
|
||||
case "$type" in
|
||||
block|transaction|signature|cold-outputs|cold-transaction|load-from-binary|load-from-json|base58|parse-url|http-client|levin|bulletproof) ;;
|
||||
*) echo "usage: $0 block|transaction|signature|cold-outputs|cold-transaction|load-from-binary|load-from-json|base58|parse-url|http-client|levin|bulletproof"; exit 1 ;;
|
||||
block|transaction|signature|cold-outputs|cold-transaction|load-from-binary|load-from-json|base58|parse-url|http-client|levin|bulletproof|utf8) ;;
|
||||
*) echo "usage: $0 block|transaction|signature|cold-outputs|cold-transaction|load-from-binary|load-from-json|base58|parse-url|http-client|levin|bulletproof|utf8"; exit 1 ;;
|
||||
esac
|
||||
|
||||
if test -d "fuzz-out/$type"
|
||||
|
||||
Binary file not shown.
@@ -200,7 +200,7 @@ namespace cryptonote
|
||||
return true;
|
||||
}
|
||||
// make RPC call to daemon
|
||||
// curl http://127.0.0.1:34568/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"height":278300}}' -H 'Content-Type: application/json'
|
||||
// curl http://127.0.0.1:34568/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_block","params":{"height":307880}}' -H 'Content-Type: application/json'
|
||||
// "wide_cumulative_difficulty": "0x14eb4d0131fe8",
|
||||
ADD_CHECKPOINT2(1, "97f4ce4d7879b3bea54dcec738cd2ebb7952b4e9bb9743262310cd5fec749340", "0x2");
|
||||
ADD_CHECKPOINT2(6969, "aa7b66e8c461065139b55c29538a39c33ceda93e587f84d490ed573d80511c87", "0x118eef693fd"); //Hard fork to v8
|
||||
@@ -216,6 +216,16 @@ namespace cryptonote
|
||||
ADD_CHECKPOINT2(256700, "389a8ab95a80e84ec74639c1078bc67b33af208ef00f53bd9609cfc40efa7059", "0x185ace3c1bd68");
|
||||
ADD_CHECKPOINT2(271600, "9597cdbdc52ca57d7dbd8f9c0a23a73194ef2ebbcfdc75c21992672706108d43", "0x1e2d2d6a2a9e8");
|
||||
ADD_CHECKPOINT2(278300, "b10dcdf7a51651f60fbcc0447409773eef1458d2c706d9a61daf467571ac19c9", "0x20a83a16d3968");
|
||||
ADD_CHECKPOINT2(282700, "79c06cafd7cb5f76bcebbf8f1ae16203bb41fd75b284bcd0eb0b457991ab7d4a", "0x22e3baf142de8");
|
||||
ADD_CHECKPOINT2(307686, "dfd056b2739c132a07629409a59a028cb7414fac23e3419e79d2f49d66fc3af5", "0x305ba542e3ea8"); // "difficulty": 25800000
|
||||
ADD_CHECKPOINT2(307692, "d822cd72037f62824ec87c9dc11768b45dc2632f697fa372e1885789c90f37fc", "0x305e124633878"); // "difficulty": 1890000
|
||||
ADD_CHECKPOINT2(307735, "60970378aecdc0a78ccf5154edcc56f23aad8554b49e4716f820461a7588bfdc", "0x3070771b9ba58"); // "difficulty": 17900000
|
||||
ADD_CHECKPOINT2(307742, "0ed835bc9fcd949b5a184cf607dcc62ac4268c9e4cf220f8b09bcce58f10916b", "0x30732f1248978"); // "difficulty": 21300000
|
||||
ADD_CHECKPOINT2(307750, "7bcafbc757237125b70f569b181eb1b66c530b10d817d7b940f7a73dc827211c", "0x30766666b3d98"); // "difficulty": 10900000
|
||||
ADD_CHECKPOINT2(307766, "02fd6c7d6bae710cfa3efb08f50e4bc9a590f6ab61eabd87e5e951338c0c36f6", "0x307d2d47a7918"); // "difficulty": 2960000
|
||||
ADD_CHECKPOINT2(307800, "3594894b4231cfdfe911afed6552f9fb4cfe6048bacd0973a3a98623ec8548ce", "0x308b305ca7618");
|
||||
ADD_CHECKPOINT2(307880, "659274b698f680c6cae2716cbd4e15ad5def23b5de98e53734c4af2c2e74bb7a", "0x30af6e91e8018");
|
||||
ADD_CHECKPOINT2(307883, "9a8c35cd10963a14bba8a9628d1776df92fee5e3153b7249f5d15726efafaaea", "0x30b0965ba5a18");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -375,7 +375,16 @@ namespace cryptonote {
|
||||
if (HEIGHT < 200 && m_nettype == TESTNET) { return 500; }
|
||||
assert(timestamps.size() == N+1);
|
||||
|
||||
uint64_t L(0), next_D, i, this_timestamp(0), previous_timestamp(0), avg_D;
|
||||
// hardcoding previously erroneously calculated difficulty entries
|
||||
if(HEIGHT == 307686) return 25800000;
|
||||
if(HEIGHT == 307692) return 1890000;
|
||||
if(HEIGHT == 307735) return 17900000;
|
||||
if(HEIGHT == 307742) return 21300000;
|
||||
if(HEIGHT == 307750) return 10900000;
|
||||
if(HEIGHT == 307766) return 2960000;
|
||||
|
||||
uint64_t i, this_timestamp(0), previous_timestamp(0);
|
||||
difficulty_type L(0), next_D, avg_D;
|
||||
|
||||
previous_timestamp = timestamps[0]-T;
|
||||
for ( i = 1; i <= N; i++) {
|
||||
@@ -386,10 +395,13 @@ namespace cryptonote {
|
||||
previous_timestamp = this_timestamp;
|
||||
}
|
||||
if (L < N*N*T/20 ) { L = N*N*T/20; }
|
||||
avg_D = static_cast<uint64_t>(( cumulative_difficulties[N] - cumulative_difficulties[0] )/ N);
|
||||
avg_D = ( cumulative_difficulties[N] - cumulative_difficulties[0] )/ N;
|
||||
|
||||
// Prevent round off error for small D and overflow for large D.
|
||||
if (avg_D > 2000000*N*N*T) {
|
||||
if (avg_D > 2000000*N*N*T && HEIGHT < 307800) {
|
||||
next_D = (avg_D/(200*L))*(N*(N+1)*T*99);
|
||||
}
|
||||
else if (avg_D > uint64_t(-1)/(N*(N+1)*T*99) && HEIGHT > 307800) {
|
||||
next_D = (avg_D/(200*L))*(N*(N+1)*T*99);
|
||||
}
|
||||
else { next_D = (avg_D*N*(N+1)*T*99)/(200*L); }
|
||||
|
||||
@@ -5460,7 +5460,7 @@ void Blockchain::cancel()
|
||||
}
|
||||
|
||||
#if defined(PER_BLOCK_CHECKPOINT)
|
||||
static const char expected_block_hashes_hash[] = "44393af098c4738ecbe664292bc345c0acb40573562cac8bb67cea75debe9f1b";
|
||||
static const char expected_block_hashes_hash[] = "392961db5c3578616c40283e5469f5fae7f628a0b4a13c87db9339cad35f8e53";
|
||||
void Blockchain::load_compiled_in_block_hashes(const GetCheckpointsCallback& get_checkpoints)
|
||||
{
|
||||
if (get_checkpoints == nullptr || !m_fast_sync)
|
||||
|
||||
@@ -549,6 +549,7 @@ namespace cryptonote
|
||||
}
|
||||
|
||||
std::vector<tx_blob_entry> have_tx;
|
||||
have_tx.reserve(new_block.tx_hashes.size());
|
||||
|
||||
// Instead of requesting missing transactions by hash like BTC,
|
||||
// we do it by index (thanks to a suggestion from moneromooo) because
|
||||
@@ -557,6 +558,7 @@ namespace cryptonote
|
||||
// Also, remember to pepper some whitespace changes around to bother
|
||||
// moneromooo ... only because I <3 him.
|
||||
std::vector<uint64_t> need_tx_indices;
|
||||
need_tx_indices.reserve(new_block.tx_hashes.size());
|
||||
|
||||
transaction tx;
|
||||
crypto::hash tx_hash;
|
||||
@@ -829,6 +831,7 @@ namespace cryptonote
|
||||
}
|
||||
|
||||
std::vector<crypto::hash> txids;
|
||||
txids.reserve(b.tx_hashes.size());
|
||||
NOTIFY_NEW_FLUFFY_BLOCK::request fluffy_response;
|
||||
fluffy_response.b.block = t_serializable_object_to_blob(b);
|
||||
fluffy_response.current_blockchain_height = arg.current_blockchain_height;
|
||||
@@ -2189,6 +2192,7 @@ skip:
|
||||
if (span.second > 0)
|
||||
{
|
||||
is_next = true;
|
||||
req.blocks.reserve(hashes.size());
|
||||
for (const auto &hash: hashes)
|
||||
{
|
||||
req.blocks.push_back(hash);
|
||||
@@ -2247,6 +2251,7 @@ skip:
|
||||
if (span.second > 0)
|
||||
{
|
||||
is_next = true;
|
||||
req.blocks.reserve(hashes.size());
|
||||
for (const auto &hash: hashes)
|
||||
{
|
||||
req.blocks.push_back(hash);
|
||||
@@ -2280,6 +2285,7 @@ skip:
|
||||
return false;
|
||||
}
|
||||
|
||||
req.blocks.reserve(req.blocks.size() + span.second);
|
||||
for (size_t n = 0; n < span.second; ++n)
|
||||
{
|
||||
req.blocks.push_back(context.m_needed_objects[n].first);
|
||||
@@ -2579,6 +2585,7 @@ skip:
|
||||
}
|
||||
|
||||
context.m_needed_objects.clear();
|
||||
context.m_needed_objects.reserve(arg.m_block_ids.size());
|
||||
uint64_t added = 0;
|
||||
std::unordered_set<crypto::hash> blocks_found;
|
||||
bool first = true;
|
||||
|
||||
@@ -51,14 +51,6 @@
|
||||
#undef MONERO_DEFAULT_LOG_CATEGORY
|
||||
#define MONERO_DEFAULT_LOG_CATEGORY "net.p2p.tx"
|
||||
|
||||
namespace
|
||||
{
|
||||
int get_command_from_message(const epee::byte_slice &msg)
|
||||
{
|
||||
return msg.size() >= sizeof(epee::levin::bucket_head2) ? SWAP32LE(((epee::levin::bucket_head2*)msg.data())->m_command) : 0;
|
||||
}
|
||||
}
|
||||
|
||||
namespace cryptonote
|
||||
{
|
||||
namespace levin
|
||||
@@ -212,7 +204,7 @@ namespace levin
|
||||
{
|
||||
const epee::byte_slice blob = make_tx_payload(std::move(txs), pad, fluff);
|
||||
p2p.for_connection(destination, [&blob](detail::p2p_context& context) {
|
||||
on_levin_traffic(context, true, true, false, blob.size(), get_command_from_message(blob));
|
||||
on_levin_traffic(context, true, true, false, blob.size(), NOTIFY_NEW_TRANSACTIONS::ID);
|
||||
return true;
|
||||
});
|
||||
return p2p.notify(NOTIFY_NEW_TRANSACTIONS::ID, epee::to_span(blob), destination);
|
||||
|
||||
@@ -2275,6 +2275,7 @@ bool t_rpc_command_executor::sync_info()
|
||||
tools::success_msg_writer() << "Next needed pruning seed: " << res.next_needed_pruning_seed;
|
||||
|
||||
tools::success_msg_writer() << std::to_string(res.peers.size()) << " peers";
|
||||
tools::success_msg_writer() << "Remote Host Peer_ID State Prune_Seed Height DL kB/s, Queued Blocks / MB";
|
||||
for (const auto &p: res.peers)
|
||||
{
|
||||
std::string address = epee::string_tools::pad_string(p.info.address, 24);
|
||||
|
||||
@@ -234,6 +234,7 @@ namespace nodetool
|
||||
return false;
|
||||
|
||||
const time_t now = time(nullptr);
|
||||
bool added = false;
|
||||
|
||||
CRITICAL_REGION_LOCAL(m_blocked_hosts_lock);
|
||||
time_t limit;
|
||||
@@ -244,7 +245,10 @@ namespace nodetool
|
||||
const std::string host_str = addr.host_str();
|
||||
auto it = m_blocked_hosts.find(host_str);
|
||||
if (it == m_blocked_hosts.end())
|
||||
{
|
||||
m_blocked_hosts[host_str] = limit;
|
||||
added = true;
|
||||
}
|
||||
else if (it->second < limit || !add_only)
|
||||
it->second = limit;
|
||||
|
||||
@@ -275,7 +279,10 @@ namespace nodetool
|
||||
conns.clear();
|
||||
}
|
||||
|
||||
MCLOG_CYAN(el::Level::Info, "global", "Host " << host_str << " blocked.");
|
||||
if (added)
|
||||
MCLOG_CYAN(el::Level::Info, "global", "Host " << host_str << " blocked.");
|
||||
else
|
||||
MINFO("Host " << host_str << " block time updated.");
|
||||
return true;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------
|
||||
|
||||
@@ -452,7 +452,7 @@ namespace cryptonote
|
||||
m_core.get_blockchain_top(res.height, top_hash);
|
||||
++res.height; // turn top block height into blockchain height
|
||||
res.top_block_hash = string_tools::pod_to_hex(top_hash);
|
||||
res.target_height = m_core.get_target_blockchain_height();
|
||||
res.target_height = m_p2p.get_payload_object().is_synchronized() ? 0 : m_core.get_target_blockchain_height();
|
||||
store_difficulty(m_core.get_blockchain_storage().get_difficulty_for_next_block(), res.difficulty, res.wide_difficulty, res.difficulty_top64);
|
||||
res.target = m_core.get_blockchain_storage().get_difficulty_target();
|
||||
res.tx_count = m_core.get_blockchain_storage().get_total_transactions() - res.height; //without coinbase
|
||||
@@ -2915,7 +2915,7 @@ namespace cryptonote
|
||||
crypto::hash top_hash;
|
||||
m_core.get_blockchain_top(res.height, top_hash);
|
||||
++res.height; // turn top block height into blockchain height
|
||||
res.target_height = m_core.get_target_blockchain_height();
|
||||
res.target_height = m_p2p.get_payload_object().is_synchronized() ? 0 : m_core.get_target_blockchain_height();
|
||||
res.next_needed_pruning_seed = m_p2p.get_payload_object().get_next_needed_pruning_stripe().second;
|
||||
|
||||
for (const auto &c: m_p2p.get_payload_object().get_connections())
|
||||
|
||||
@@ -4745,9 +4745,14 @@ bool simple_wallet::try_connect_to_daemon(bool silent, uint32_t* version)
|
||||
if (!m_wallet->check_connection(version))
|
||||
{
|
||||
if (!silent)
|
||||
fail_msg_writer() << tr("wallet failed to connect to daemon: ") << m_wallet->get_daemon_address() << ". " <<
|
||||
tr("Daemon either is not started or wrong port was passed. "
|
||||
"Please make sure daemon is running or change the daemon address using the 'set_daemon' command.");
|
||||
{
|
||||
if (m_wallet->is_offline())
|
||||
fail_msg_writer() << tr("wallet failed to connect to daemon, because it is set to offline mode");
|
||||
else
|
||||
fail_msg_writer() << tr("wallet failed to connect to daemon: ") << m_wallet->get_daemon_address() << ". " <<
|
||||
tr("Daemon either is not started or wrong port was passed. "
|
||||
"Please make sure daemon is running or change the daemon address using the 'set_daemon' command.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (!m_allow_mismatched_daemon_version && ((*version >> 16) != CORE_RPC_VERSION_MAJOR))
|
||||
@@ -9278,7 +9283,7 @@ bool simple_wallet::run()
|
||||
|
||||
refresh_main(0, ResetNone, true);
|
||||
|
||||
m_auto_refresh_enabled = m_wallet->auto_refresh();
|
||||
m_auto_refresh_enabled = !m_wallet->is_offline() && m_wallet->auto_refresh();
|
||||
m_idle_thread = boost::thread([&]{wallet_idle_thread();});
|
||||
|
||||
message_writer(console_color_green, false) << "Background refresh thread started";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#define DEF_MONERO_VERSION_TAG "@VERSIONTAG@"
|
||||
#define DEF_MONERO_VERSION "0.9.2.1"
|
||||
#define DEF_MONERO_VERSION "0.9.3.3"
|
||||
#define DEF_MONERO_RELEASE_NAME "Illiterate Illuminati"
|
||||
#define DEF_MONERO_VERSION_FULL DEF_MONERO_VERSION "-" DEF_MONERO_VERSION_TAG
|
||||
#define DEF_MONERO_VERSION_IS_RELEASE @VERSION_IS_RELEASE@
|
||||
|
||||
@@ -8218,12 +8218,12 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
|
||||
const transfer_details &td = m_transfers[idx];
|
||||
const uint64_t amount = td.is_rct() ? 0 : td.amount();
|
||||
std::unordered_set<uint64_t> seen_indices;
|
||||
uint64_t approx_blockchain_height = m_nettype == TESTNET ? 0 : (time(NULL) - 1522624244)/317;
|
||||
uint64_t approx_blockchain_height = m_nettype == TESTNET ? 0 : (time(NULL) - 1522624244)/313;
|
||||
uint64_t unlock_height = td.m_block_height + std::max<uint64_t>(CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE, CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS);
|
||||
if (td.m_tx.unlock_time < CRYPTONOTE_MAX_BLOCK_NUMBER && td.m_tx.unlock_time > unlock_height)
|
||||
unlock_height = td.m_tx.unlock_time;
|
||||
uint64_t blocks_to_unlock = unlock_height > approx_blockchain_height ? unlock_height - approx_blockchain_height : 0;
|
||||
size_t requested_outputs_count = base_requested_outputs_count + (td.is_rct() ? blocks_to_unlock - CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE : 0);
|
||||
size_t requested_outputs_count = base_requested_outputs_count + (td.is_rct() ? blocks_to_unlock - CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE : 0) + 288;
|
||||
size_t start = req.outputs.size();
|
||||
bool use_histogram = amount != 0 || !has_rct_distribution;
|
||||
|
||||
@@ -8539,12 +8539,12 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
|
||||
for(size_t idx: selected_transfers)
|
||||
{
|
||||
const transfer_details &td = m_transfers[idx];
|
||||
uint64_t approx_blockchain_height = m_nettype == TESTNET ? 0 : (time(NULL) - 1522624244)/317;
|
||||
uint64_t approx_blockchain_height = m_nettype == TESTNET ? 0 : (time(NULL) - 1522624244)/313;
|
||||
uint64_t unlock_height = td.m_block_height + std::max<uint64_t>(CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE, CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS);
|
||||
if (td.m_tx.unlock_time < CRYPTONOTE_MAX_BLOCK_NUMBER && td.m_tx.unlock_time > unlock_height)
|
||||
unlock_height = td.m_tx.unlock_time;
|
||||
uint64_t blocks_to_unlock = unlock_height > approx_blockchain_height ? unlock_height - approx_blockchain_height : 0;
|
||||
size_t requested_outputs_count = base_requested_outputs_count + (td.is_rct() ? blocks_to_unlock - CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE : 0);
|
||||
size_t requested_outputs_count = base_requested_outputs_count + (td.is_rct() ? blocks_to_unlock - CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE : 0) + 288;
|
||||
outs.push_back(std::vector<get_outs_entry>());
|
||||
outs.back().reserve(fake_outputs_count + 1);
|
||||
const rct::key mask = td.is_rct() ? rct::commit(td.amount(), td.m_mask) : rct::zeroCommit(td.amount());
|
||||
@@ -12124,7 +12124,7 @@ uint64_t wallet2::get_daemon_blockchain_target_height(string &err)
|
||||
|
||||
uint64_t wallet2::get_approximate_blockchain_height() const
|
||||
{
|
||||
uint64_t approx_blockchain_height = m_nettype == TESTNET ? 0 : (time(NULL) - 1522624244)/315;
|
||||
uint64_t approx_blockchain_height = m_nettype == TESTNET ? 0 : (time(NULL) - 1522624244)/313;
|
||||
LOG_PRINT_L2("Calculated blockchain height: " << approx_blockchain_height);
|
||||
return approx_blockchain_height;
|
||||
}
|
||||
|
||||
@@ -1546,6 +1546,7 @@ private:
|
||||
void finish_rescan_bc_keep_key_images(uint64_t transfer_height, const crypto::hash &hash);
|
||||
void enable_dns(bool enable) { m_use_dns = enable; }
|
||||
void set_offline(bool offline = true);
|
||||
bool is_offline() const { return m_offline; }
|
||||
|
||||
uint64_t credits() const { return m_rpc_payment_state.credits; }
|
||||
void credit_report(uint64_t &expected_spent, uint64_t &discrepancy) const { expected_spent = m_rpc_payment_state.expected_spent; discrepancy = m_rpc_payment_state.discrepancy; }
|
||||
|
||||
@@ -80,17 +80,22 @@ file(COPY
|
||||
data/signed_monero_tx
|
||||
DESTINATION data)
|
||||
|
||||
add_subdirectory(core_tests)
|
||||
add_subdirectory(fuzz)
|
||||
add_subdirectory(crypto)
|
||||
add_subdirectory(functional_tests)
|
||||
add_subdirectory(performance_tests)
|
||||
add_subdirectory(core_proxy)
|
||||
add_subdirectory(unit_tests)
|
||||
add_subdirectory(difficulty)
|
||||
add_subdirectory(block_weight)
|
||||
add_subdirectory(hash)
|
||||
add_subdirectory(net_load_tests)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "fuzz" OR OSSFUZZ)
|
||||
add_subdirectory(fuzz)
|
||||
else ()
|
||||
add_subdirectory(core_tests)
|
||||
add_subdirectory(fuzz)
|
||||
add_subdirectory(crypto)
|
||||
add_subdirectory(functional_tests)
|
||||
add_subdirectory(performance_tests)
|
||||
add_subdirectory(core_proxy)
|
||||
add_subdirectory(unit_tests)
|
||||
add_subdirectory(difficulty)
|
||||
add_subdirectory(block_weight)
|
||||
add_subdirectory(hash)
|
||||
add_subdirectory(net_load_tests)
|
||||
endif()
|
||||
|
||||
if (BUILD_GUI_DEPS)
|
||||
add_subdirectory(libwallet_api_tests)
|
||||
endif()
|
||||
|
||||
0
tests/data/fuzz/utf8/UTF8_1
Normal file
0
tests/data/fuzz/utf8/UTF8_1
Normal file
BIN
tests/data/fuzz/utf8/UTF8_2
Normal file
BIN
tests/data/fuzz/utf8/UTF8_2
Normal file
Binary file not shown.
@@ -218,3 +218,13 @@ set_property(TARGET tx-extra_fuzz_tests
|
||||
PROPERTY
|
||||
FOLDER "tests")
|
||||
|
||||
monero_add_minimal_executable(utf8_fuzz_tests utf8.cpp fuzzer.cpp)
|
||||
target_link_libraries(utf8_fuzz_tests
|
||||
PRIVATE
|
||||
common
|
||||
epee
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${Boost_CHRONO_LIBRARY}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${EXTRA_LIBRARIES}
|
||||
$ENV{LIB_FUZZING_ENGINE})
|
||||
|
||||
39
tests/fuzz/utf8.cpp
Normal file
39
tests/fuzz/utf8.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
// Copyright (c) 2017-2020, The Monero Project
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
// conditions and the following disclaimer.
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other
|
||||
// materials provided with the distribution.
|
||||
//
|
||||
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
// used to endorse or promote products derived from this software without specific
|
||||
// prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include "include_base_utils.h"
|
||||
#include "file_io_utils.h"
|
||||
#include "common/utf8.h"
|
||||
#include "fuzzer.h"
|
||||
|
||||
BEGIN_INIT_SIMPLE_FUZZER()
|
||||
END_INIT_SIMPLE_FUZZER()
|
||||
|
||||
BEGIN_SIMPLE_FUZZER()
|
||||
tools::utf8canonical(std::string((const char*)buf, len), [](wint_t c)->wint_t { return c; });
|
||||
END_SIMPLE_FUZZER()
|
||||
@@ -15,6 +15,10 @@ On the first run, the script will complain about the missing ClangBuildAnalyzer
|
||||
`utils/health/clang-tidy-run.sh`
|
||||
Performs Lint checks on the source code and stores the result in the build directory. More information on the [home page](https://clang.llvm.org/extra/clang-tidy/).
|
||||
|
||||
##include-what-you-use
|
||||
`utils/health/clang-include-what-you-use-run.sh`
|
||||
Analyses the header file hierarchy and delivers hints on how to reduce their complexity. More information on the [home page](https://include-what-you-use.org/).
|
||||
|
||||
|
||||
##Valgrind checks
|
||||
`utils/health/valgrind-tests.sh`
|
||||
|
||||
75
utils/health/clang-include-what-you-use-run.sh
Executable file
75
utils/health/clang-include-what-you-use-run.sh
Executable file
@@ -0,0 +1,75 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
# Copyright (c) 2014-2020, The Monero Project
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are
|
||||
# permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
# conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
# of conditions and the following disclaimer in the documentation and/or other
|
||||
# materials provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software without specific
|
||||
# prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# Include What You Use analyses the complexity of your header hierarchy and proposes optimisations.
|
||||
# User documentation:
|
||||
# https://github.com/include-what-you-use/include-what-you-use/blob/master/README.md
|
||||
|
||||
# Build variables
|
||||
PROG="include-what-you-use"
|
||||
PROG_SHORT="iwyu"
|
||||
DIR_BUILD="build/clang-$PROG_SHORT"
|
||||
|
||||
RESULT="$PROG_SHORT-result.txt"
|
||||
|
||||
if hash "$PROG"; then
|
||||
echo "Found: $PROG"
|
||||
else
|
||||
echo "Couldn't find: $PROG"
|
||||
echo "Please run the below command to install $PROG:"
|
||||
echo "sudo apt install $PROG_SHORT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$DIR_BUILD" && cd "$DIR_BUILD"
|
||||
rm `find . -name "CMakeCache.txt"` || true
|
||||
|
||||
UWYU_COMMAND="$PROG;-Xiwyu;any;-Xiwyu;iwyu;-Xiwyu;args" # Copy-pasted from the user docs.
|
||||
|
||||
cmake ../.. \
|
||||
-DCMAKE_C_COMPILER=clang \
|
||||
-DCMAKE_CXX_COMPILER=clang++ \
|
||||
-DUSE_CCACHE=ON \
|
||||
-DCMAKE_C_INCLUDE_WHAT_YOU_USE="$UWYU_COMMAND" \
|
||||
-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="$UWYU_COMMAND" \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
-DBUILD_TESTS=ON
|
||||
|
||||
make clean # Clean up to generate the full report
|
||||
time make -k 2>&1 | tee "$RESULT" # Run the scan. -k means: ignore errors
|
||||
#time make -k easylogging 2>&1 | tee $RESULT # Quick testing: build a single target
|
||||
KPI=$(cat "$RESULT" | wc -l)
|
||||
tar -cJvf "$RESULT.txz" "$RESULT" # Zip the result, because it's huge.
|
||||
rm -v "$RESULT"
|
||||
|
||||
echo ""
|
||||
echo "Readable result stored in: $DIR_BUILD/$RESULT.gz"
|
||||
|
||||
echo "$KPI" > "kpis.txt"
|
||||
161
utils/health/valgrind-tests.sh
Executable file
161
utils/health/valgrind-tests.sh
Executable file
@@ -0,0 +1,161 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
# Copyright (c) 2014-2020, The Monero Project
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without modification, are
|
||||
# permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
# conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
# of conditions and the following disclaimer in the documentation and/or other
|
||||
# materials provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its contributors may be
|
||||
# used to endorse or promote products derived from this software without specific
|
||||
# prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# This script is able to run valgrind's callgrind, cachegrind and memcheck for a given set of executables.
|
||||
# It expects ONE PARAMETER, which points to a file with paths to executables and their arguments, written line by line.
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Please provide an argument, which points to a file with paths to executables and their arguments, written line by line. For example:"
|
||||
echo ""
|
||||
echo "ls -l -h"
|
||||
echo "build/tests/unit_tests/unit_tests"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FILE_IN="$1"
|
||||
DIR_OUT="build/valgrind-output" # Using build as the base output directory, as it's ignored in .gitignore
|
||||
|
||||
function is_file_or_exit {
|
||||
FILE="${1}"
|
||||
if [ -f $FILE ]; then
|
||||
echo "The input file $FILE exists. Can proceed."
|
||||
else
|
||||
echo "The input file $FILE doesn't exist."
|
||||
exit 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
function is_tool_or_exit {
|
||||
TOOL="${1}"
|
||||
if $(hash ${TOOL}); then
|
||||
echo "${TOOL} is installed. Can proceed."
|
||||
else
|
||||
echo "Please install ${TOOL} to continue."
|
||||
exit 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
function get_tool_out_file_base {
|
||||
EXE="${1}"
|
||||
TOOL="${2}"
|
||||
|
||||
EXE_NAME=$(basename $EXE)
|
||||
local retval="${DIR_OUT}/${EXE_NAME}-${TOOL}"
|
||||
echo "$retval"
|
||||
}
|
||||
|
||||
function get_tool_out_file {
|
||||
EXE="${1}"
|
||||
TOOL="${2}"
|
||||
|
||||
FILE_OUT_BASE=$(get_tool_out_file_base ${EXE} ${TOOL})
|
||||
local retval="--${TOOL}-out-file=${FILE_OUT_BASE}.out"
|
||||
echo "$retval"
|
||||
}
|
||||
|
||||
function run_valgrind_4_executable {
|
||||
EXE="${1}"
|
||||
ARGS="${2}"
|
||||
TOOL="${3}"
|
||||
EXTRA_OPTS="${4}"
|
||||
FILE_OUT_TOOL="${5}"
|
||||
FILE_OUT_BASE=$(get_tool_out_file_base ${EXE} ${TOOL})
|
||||
|
||||
echo "Runnig '${TOOL}' for '${EXE}' with args '${ARGS}'"
|
||||
echo "EXTRA_OPTS = ${EXTRA_OPTS}"
|
||||
echo "FILE_OUT_TOOL = ${FILE_OUT_TOOL}"
|
||||
if ! valgrind --tool=${TOOL} ${FILE_OUT_TOOL} --log-file="${FILE_OUT_BASE}.log" ${EXTRA_OPTS} ${EXE} ${ARGS}; then
|
||||
echo "FAILED in runnig ${TOOL} for ${EXE} !"
|
||||
fi
|
||||
}
|
||||
|
||||
function run_valgrind_4_executable_callgrind {
|
||||
EXE="${1}"
|
||||
ARGS="${2}"
|
||||
TOOL="callgrind"
|
||||
EXTRA_OPTS="--dump-instr=yes --simulate-cache=yes --collect-jumps=yes"
|
||||
FILE_OUT_TOOL=$(get_tool_out_file ${EXE} ${TOOL})
|
||||
|
||||
run_valgrind_4_executable ${EXE} "${ARGS}" ${TOOL} "${EXTRA_OPTS}" ${FILE_OUT_TOOL}
|
||||
}
|
||||
|
||||
function run_valgrind_4_executable_cachegrind {
|
||||
EXE="${1}"
|
||||
ARGS="${2}"
|
||||
TOOL="cachegrind"
|
||||
EXTRA_OPTS=""
|
||||
FILE_OUT_TOOL=$(get_tool_out_file ${EXE} ${TOOL})
|
||||
|
||||
run_valgrind_4_executable ${EXE} "${ARGS}" ${TOOL} "${EXTRA_OPTS}" ${FILE_OUT_TOOL}
|
||||
}
|
||||
|
||||
function run_valgrind_4_executable_memcheck {
|
||||
EXE="${1}"
|
||||
ARGS="${2}"
|
||||
TOOL="memcheck"
|
||||
#EXTRA_OPTS="--leak-check=yes" # Minimalistic
|
||||
EXTRA_OPTS="--leak-check=full --show-leak-kinds=all --track-origins=yes"
|
||||
FILE_OUT_TOOL="" # memcheck has no special out file, only the log
|
||||
|
||||
run_valgrind_4_executable ${EXE} "${ARGS}" ${TOOL} "${EXTRA_OPTS}" ${FILE_OUT_TOOL}
|
||||
}
|
||||
|
||||
function run_valgrind_4_executable_all {
|
||||
EXE_ARGS_ARR=(${1})
|
||||
EXE=${EXE_ARGS_ARR[0]} # First element of the array
|
||||
ARGS=${EXE_ARGS_ARR[@]:1} # Every next element
|
||||
|
||||
#EXE="ls" # A quick check of the happy path
|
||||
#EXE="nothere" # A quick check of error handling - no such executable
|
||||
#EXE=/bin/false # A quick check of error handling - executable returned != 0
|
||||
|
||||
run_valgrind_4_executable_memcheck ${EXE} "${ARGS}"
|
||||
run_valgrind_4_executable_cachegrind ${EXE} "${ARGS}"
|
||||
run_valgrind_4_executable_callgrind ${EXE} "${ARGS}"
|
||||
}
|
||||
|
||||
is_tool_or_exit valgrind
|
||||
is_file_or_exit "$FILE_IN"
|
||||
echo "All OK."
|
||||
echo "Will perform checks for the following executables and their arguments:"
|
||||
while IFS= read -r line; do
|
||||
echo "$line"
|
||||
done < "$FILE_IN"
|
||||
|
||||
mkdir -p "$DIR_OUT"
|
||||
while IFS= read -r line; do
|
||||
echo "$line"
|
||||
run_valgrind_4_executable_all "$line"
|
||||
done < "$FILE_IN"
|
||||
|
||||
echo "Done. All data saved in ${DIR_OUT}"
|
||||
|
||||
Reference in New Issue
Block a user