Commit Graph
100 Commits
Author SHA1 Message Date
moneromooo-monero 262e391fb1 mlog: handle filenames without parent directories
eg, --log-file=foo.log

This would otherwise throw and crash with a stack overflow
2018-07-26 22:49:54 +01:00
moneromooo-monero d6440ab319 wallet2: recover from index out of hashchain bounds error
This can happen when there's a very large reorg on the daemon
(ie, on testnet)
2018-07-16 23:13:56 +01:00
moneromooo-monero 45e419bd5c db: store cumulative rct output distribution in the db for speed
This gets rid of the temporary precalc cache.

Also make the RPC able to send data back in binary or JSON,
since there can be a lot of data

This bumps the LMDB database format to v3, with migration.
2018-07-13 11:37:04 +01:00
moneromooo-monero fc39d3b23c wallet2: ensure outputs are processed only once
This should be proof against any way one might get to multiple
processing, such as generating the same derivation from the
same pubkey, etc
2018-07-08 12:56:51 +01:00
moneromooo-monero 58cceaad71 wallet2: fix double counting outs if the tx pubkey is duplicated 2018-07-03 14:16:30 +01:00
moneromooo-monero 8c4db68ff7 node_rpc_proxy: factor a few RPC calls using get_info
Takes advantage of caching
2018-07-02 17:59:44 +01:00
moneromooo-monero d95bc44c6b blockchain: fix getting invalid block data on failure 2018-06-29 15:50:34 +01:00
moneromooo-monero dead780f8a abstract_tcp_server2: fix use after free 2018-06-29 15:40:48 +01:00
moneromooo-monero aa0ea0aafc blockchain: set the m_verifivation_failed flag in a couple more places
when a block being added to the main chain is invalid.

This ensures the peer is banned after a number of these.
2018-06-28 16:57:22 +01:00
moneromooo-monero 438d52deaf remove epee from link lines where it's redundant
For some reason, this confuses and kills ASAN on startup
as it thinks const uint8_t ipv4_network_address::ID is
defined multiple times.
2018-06-28 16:45:22 +01:00
moneromooo-monero ef649f998d crypto: remove unused unsafe random scalar generator 2018-06-28 16:44:13 +01:00
moneromooo-monero 3474154b75 gtest: use -fPIC with CLANG too 2018-06-28 16:42:52 +01:00
moneromooo-monero 9a39b7dd7f wallet2: fix build for windows (std::max again) 2018-06-28 00:47:48 +01:00
moneromooo-monero 84d9e7faec blockchain: fix build after waiter::wait prototype change 2018-06-28 00:24:39 +01:00
moneromooo-monero 9b38551c3c wallet_rpc_server: fix build - forgot to build rpc version 2018-06-27 23:34:02 +01:00
moneromooo-monero dcbc17e97e wallet: include a suggested number of confirmations based on amount
This is based on how much an attacking miner stands to lose in block
rewardy by mining a private chain which double spends a payment.
This is not foolproof, since mining is based on luck, and breaks
down as the attacking miner nears 50% of the network hash rate,
and the estimation is based on a constant block reward.
2018-06-27 21:38:21 +01:00
moneromooo-monero 80d7c6c730 blockchain_utilities: report file offset where a read error occurs 2018-06-27 14:11:35 +01:00
moneromooo-monero e6f4d4acf0 unit_tests: do not recreate the same base rct sig all the time
Helps a bit when running with valgrind
2018-06-27 11:11:14 +01:00
moneromooo-monero 0e4c7d0fae wallet2: cache ringdb key while refreshing
Speeds up syncing with a lot of outgoing outputs as key generation
runs Cryptonight.
2018-06-26 22:15:38 +01:00
moneromooo-monero 2771a18e85 threadpool: allow leaf functions to run concurrently
Decrease the number of worker threads by one to account
for the fact the calling thread acts as a worker thread now
2018-06-26 22:15:22 +01:00
moneromooo-monero 2704624eae wallet2: remove unneeded divisions 2018-06-26 22:15:20 +01:00
moneromooo-monero 5d3e70229e wallet2: remove old blockchain size cache hack 2018-06-26 22:15:18 +01:00
moneromooo-monero dcfd299239 wallet2: speedup refresh
key derivation and checking for incoming outputs are threaded
in batch before adding blocks to the local blockchain. Other
minor bits and bobs are also cached.
2018-06-26 22:15:16 +01:00
moneromooo-monero ef2cb63287 blockchain: simplify/speedup handle_get_objects 2018-06-26 22:15:14 +01:00
moneromooo-monero f025ae9760 wallet2: avoid re-parsing blocks when refreshing in a loop 2018-06-26 22:15:12 +01:00
moneromooo-monero 41be339655 wallet2: avoid duplicate parsing of tx extra 2018-06-26 22:15:10 +01:00
moneromooo-monero f7f1917ed4 wallet2: remove useless device locking 2018-06-26 22:14:35 +01:00
moneromooo-monero ba8331ce41 wallet2: parse blocks in the RPC thread, not the processing thread
Processing typically is the bottleneck
2018-06-26 22:14:33 +01:00
moneromooo-monero 31a895e876 wallet2: simplify/speedup process_blocks 2018-06-26 22:14:31 +01:00
moneromooo-monero 57ea90285c wallet: don't process miner tx if we're refreshing with no-coinbase 2018-06-26 22:14:26 +01:00
moneromooo-monero a830db2577 rpc: rework to avoid repeated calculations in get_blocks.bin 2018-06-26 22:14:23 +01:00
moneromooo-monero ed2c81ed95 replace std::list with std::vector on some hot paths
also use reserve where appropriate
2018-06-26 22:14:21 +01:00
moneromooo-monero 209ec963b5 rpc: sanity check on number of txes in a block 2018-06-26 22:14:18 +01:00
moneromooo-monero 6795bd0d4e rpc: add option to skip coinbase info in get_blocks.bin 2018-06-26 22:14:16 +01:00
moneromooo-monero a2b557fe5c wallet2: use std::move on containers where appropriate 2018-06-26 22:14:14 +01:00
moneromooo-monero 50af3579ee alt_chain_info can now give more info about a particular alt chain 2018-06-26 08:19:51 +01:00
moneromooo-monero 87e158b5b9 device_ledger: factor the prologue code 2018-06-25 12:35:10 +01:00
moneromooo-monero 41b4bf9d6d tx_pool: cache check_tx_inputs results
This is called a lot when creating a block template, and
does not change until the blockchain changes.
This also avoids tx parsing when cached.
2018-06-24 11:22:26 +01:00
moneromooo-monero 34de7bc267 device_ledger: fix buffer underflow on bad data from device 2018-06-23 15:43:31 +01:00
moneromooo-monero 41e9cab4e1 device: misc cleanup
use snprintf "just in case" where appropriate
consistently use unsigned for temp values
pass std::string by const ref rather than by value
add length check (which can't happen in practice) for memcpy
2018-06-23 15:28:48 +01:00
moneromooo-monero 3b4dec2d12 device_ledger: fix potential buffer overflow from bad size calc 2018-06-23 15:28:45 +01:00
moneromooo-monero 9d7f6e6089 simplewallet: init trusted daemon flag to false when autodetecting 2018-06-23 09:53:50 +01:00
moneromooo-monero df9d50a8a4 wallet2: fix read buffer overflow in import_key_images 2018-06-23 09:22:20 +01:00
moneromooo-monero 3e46db97e5 rpc: add a non binary get_transaction_pool_hashes RPC 2018-06-21 09:02:42 +01:00
moneromooo-monero e5592c4bab rpc: add blockchain disk size to getinfo
This should help new nodes predict how much disk space will be
needed for a full sync
2018-06-20 23:48:37 +01:00
moneromooo-monero 2a19697bd4 wallet2: fix double header in unsigned transfer file 2018-06-19 22:30:02 +01:00
moneromooo-monero 1a526ed571 abstract_tcp_server2: restart async accept on error 2018-06-18 23:34:01 +01:00
moneromooo-monero 09f43b9a6b crypto: add a README pointing to the SUPERCOP licence 2018-06-18 21:28:08 +01:00
moneromooo-monero 6cb97076ce simplewallet: remove leftover global debug trace 2018-06-18 21:05:13 +01:00
moneromooo-monero 5b5828fcec zmq_server: fix bind call when address and/or port are empty 2018-06-17 21:25:11 +01:00
moneromooo-monero bc443494f3 wallet2: fix out of sync account tag cache
This would cause crashes when trying to tag an account that was
just created
2018-06-15 20:18:12 +01:00
moneromooo-monero 8db23df581 wallet: on first refresh, start off with a quantized height
for privacy reasons, so an untrusted node can't easily track
wallets from IP address to IP address, etc. The granularity
is 1024 blocks, which is about a day and a half.
2018-06-13 22:44:27 +01:00
moneromooo-monero 2d10830cfb db_ldmb: print db version when complaining about incompatibility 2018-06-11 17:57:02 +01:00
moneromooo-monero 55c7fb87a9 epee: adaptive connection timeout system
a connection's timeout is halved for every extra connection
from the same host.

Also keep track of when we don't need to use a connection
anymore, so we can close it and free the resource for another
connection.

Also use the longer timeout for non routable local addresses.
2018-06-10 19:39:38 +01:00
moneromooo-monero 03096150c6 device_ledger: fix bad memory access on connect error 2018-06-09 20:52:34 +01:00
moneromooo-monero 2d5921eefa blockchain: avoid duplicate db query for height 2018-06-09 19:51:27 +01:00
moneromooo-monero 1789b76b5d cryptonote_protocol_handler: log when dropping a peer 2018-06-09 19:27:21 +01:00
moneromooo-monero 87665281ea epee: fallback to a counter if gmtime fails when rotating logs 2018-06-09 19:23:48 +01:00
moneromooo-monero 4ecf71405f epee: fix include for ofstream 2018-06-09 19:19:27 +01:00
moneromooo-monero f4e329583e simplewallet: set_ring can now take a file with rings 2018-06-09 00:28:31 +01:00
moneromooo-monero 948c48271a simplewallet: grammar fix in warning message 2018-06-08 21:28:11 +01:00
moneromooo-monero 284fe6438d db_lmdb: warn about slowness when running off a spinning disk 2018-06-08 20:59:02 +01:00
moneromooo-monero 2bb2c1b9d7 password: flush cout when prompting for password without newline 2018-06-07 13:48:30 +01:00
moneromooo-monero d7a6b72c15 wallet2: fix bulletproof cold signing
Cold signing was always using Borromean range proofs, causing
a larger tx, and an incorrect fee
2018-06-07 12:29:30 +01:00
moneromooo-monero c367609447 blockchain_import: warn+delay about using --dangerous-unverified-import
This is the new name for --guard-against-pwnage 0
2018-06-07 06:47:00 +01:00
moneromooo-monero 8cc46069ac snap: strip metadata from icon.png
Reported to "contain[s] an embedded color calibration (ICC) profile
which is copyright Hewlett Packard but lack license"
2018-06-06 15:29:18 +01:00
moneromooo-monero f24cbc5245 blockchain: fix deadlock with the difficulty cache 2018-06-06 10:37:51 +01:00
moneromooo-monero 62c8c07c47 wallet: do not log by default if we're not asked to log to console
This means monero-wallet-rpc still does, but the user level program
does not.
2018-06-06 10:15:13 +01:00
moneromooo-monero 01cc978722 ringct: remove an unnecessary scalarmultBase in zeroCommit 2018-06-06 10:14:36 +01:00
moneromooo-monero d81e042306 tx_pool: initialize bitflags padding since it gets written to storage
Avoids valgrind reporting uninitialized data usage
2018-06-05 20:26:44 +01:00
moneromooo-monero 2b3357ee98 README: mention --untrusted-daemon
when connecting the wallet to a daemon on a tor hidden service
2018-06-05 16:55:27 +01:00
moneromooo-monero 941a608d52 util: consider Tor/I2P addresses to be non local 2018-06-05 16:55:23 +01:00
moneromooo-monero 8962f0032f simplewallet: add optional trusted/untrusted argument to set_daemon
Otherwise the previous daemon's trustedness would carry over.
If not specified, the local address check is performed again.
2018-06-05 16:55:20 +01:00
moneromooo-monero f2cb56a2eb protocol: drop (and increase fails) if most blocks hashes are invalid 2018-06-03 17:34:08 +01:00
moneromooo-monero f0322a083a blockchain: demote a hash-of-hashes validation warning to debug
This data comes from untrusted peers, and validation failures
are therefore normal.
2018-06-02 23:48:12 +01:00
moneromooo-monero 2b0c632f32 tx_pool: hold off parsing a tx blob till we actually need it 2018-06-02 09:17:41 +01:00
moneromooo-monero 4f3a4fb701 blockchain: return error when requesting non existent output
avoids RPC thread dying, causing the wallet to timeout
2018-06-01 21:52:04 +01:00
moneromooo-monero 5db9e3c28e unit_tests: add tests for local IP range detection 2018-06-01 21:47:25 +01:00
moneromooo-monero f8dd433110 epee: fix detection of 172.16.0.0/172.31.255.255 local IP range 2018-06-01 21:47:21 +01:00
moneromooo-monero ab87e7fdae rpc: the cache is still for non cumulative on that branch 2018-06-01 09:05:47 +01:00
moneromooo-monero d3447364d0 rpc: convert distribution to cumulative after caching
This avoids double conversion on a later cache hit
2018-05-31 16:54:57 +01:00
moneromooo-monero f80b1571c6 wallet2: don't ask for pruned txes yet, we still parse the entire tx 2018-05-31 16:46:58 +01:00
moneromooo-monero 1aae39dff2 daemon: fix readline interfering with std::cerr usage
Once readline is initialized, std::cerr's operator<< will
output a 0xff byte for unknown reasons.
2018-05-31 12:15:06 +01:00
moneromooo-monero b665bab1d6 rpc: fix get_output_distribution cache for the cumulative case
The distribution was not converted to cumulative after a cache hit
2018-05-30 15:03:36 +01:00
moneromooo-monero e09710f76e blockchain_blackball: also blackball N N-sized duplicate rings
These are unlikely to happen at random, but Wijaya et al made
a paper about it, so people might try it on purpose now (and it
turns out it's easy to add anyway)
2018-05-30 11:45:20 +01:00
moneromooo-monero 66f4700f57 blockchain_blackball: add incremental mode 2018-05-30 11:45:16 +01:00
moneromooo-monero b26cd26333 blockchain_utilities: do not link against unneeded p2p lib 2018-05-30 11:45:13 +01:00
moneromooo-monero 5a412b7a3f disable file size sanity check when loading the wallet cache 2018-05-28 14:58:22 +01:00
moneromooo-monero e942d34d54 protocol: do not switch to unsafe sync mode for just a few blocks 2018-05-28 14:36:12 +01:00
moneromooo-monero 740da1ba95 core: fix automatic safe db sync mode switching 2018-05-28 12:14:04 +01:00
moneromooo-monero dfd36bbebb http_protocol_handler: limit the number of starting newlines 2018-05-27 09:43:54 +01:00
moneromooo-monero 4d15864728 abstract_tcp_server2: timeout on RPC connections 2018-05-26 20:18:36 +01:00
moneromooo-monero 885a117ddb http_protocol_handler: speedup newline discarding 2018-05-26 20:18:33 +01:00
moneromooo-monero 6a58c88e2d console_handler: fix start_default_console use of prompt parameter
It had not been updated to the function type change
2018-05-26 20:18:30 +01:00
moneromooo-monero a87980f6c2 fix build with GCC 8.1.0 2018-05-26 14:54:10 +01:00
moneromooo-monero de1ffe07b1 p2p: warn when no incoming connections are seen for a while 2018-05-26 14:37:07 +01:00
moneromooo-monero b9389e582e db_lmdb: save pruned and prunable tx data separately
This bumps DB version to 2, migration code will run for v1 DBs
2018-05-23 22:48:12 +01:00
moneromooo-monero 64f82e0481 unit_tests: fix build after get_output_didstribution signature change 2018-05-21 20:49:02 +01:00
moneromooo-monero 5f8ffca34d speed up get_output_distribution (and precalc common case) 2018-05-21 19:51:58 +01:00
moneromooo-monero 3147468d35 unit_tests: add threadpool unit test 2018-05-20 12:06:10 +01:00