Commit Graph
100 Commits
Author SHA1 Message Date
moneromooo-monero ada0e23a84 updates: fix user/auto url split 2017-02-22 13:04:07 +00:00
moneromooo-monero 14d0e00235 wallet2_api: add updates check api 2017-02-22 13:03:45 +00:00
moneromooo-monero 5901331669 updates: remove testnet case
It need not be any different
2017-02-22 11:20:44 +00:00
moneromooo-monero 822577eb42 updates: we now have a user URL, and an automatic one
So the user can use https, while the automatic does not have to
2017-02-22 11:20:40 +00:00
moneromooo-monero 9f17b1a30f updates: s/monerod/monero/ for the main download
Also print download success message as global log
2017-02-22 11:20:37 +00:00
moneromooo-monero 6a5dfb88d2 updates: add all update servers 2017-02-22 11:20:24 +00:00
moneromooo-monero 72d40f13a4 updates: use HTTP, not HTTPS
The files are hashed and the hashes signed
2017-02-22 09:08:35 +00:00
moneromooo-monero 708758b737 core: do not download an update we already downloaded 2017-02-21 22:23:59 +00:00
moneromooo-monero 45101550f2 updates: use updates host, not downloads, for HTTP 2017-02-21 22:21:59 +00:00
moneromooo-monero 56586bde9e mlog: restrict net.p2p to FATAL by default 2017-02-21 17:37:03 +00:00
moneromooo-monero 417b126fc4 Fix core_tests breaking on startup
You're wondering how this fixes core tests, aren't you...

It prevents the miner (initialized by cryptonote::core) from
breaking trying to access arguments that were not added.
Since the tests don't use the miner directly, it makes more
sense to have cryptonote_core add those, since it also uses
the miner.
2017-02-21 15:06:07 +00:00
moneromooo-monero 5664826a84 unit_tests: hardfork unit test now needs get_block_blob_from_height 2017-02-21 14:48:34 +00:00
moneromooo-monero 13cd544de3 Makefile: fix copy/paste mistake in targets (s/freebsd/mac) 2017-02-21 10:25:58 +00:00
moneromooo-monero e74b3ab5f7 core: add p2p bind port options from net_node
They're now used by core to determine the data directory to use
for the txpool directory.

This fixes an assert in the core tests, which don't use the RPC
server, which normally initializes the P2P code.
2017-02-21 09:35:23 +00:00
moneromooo-monero a5a0a3c894 core: updates can now be downloaded (and SHA256 hash checked) 2017-02-20 22:58:37 +00:00
moneromooo-monero 216f062eb8 util: add a SHA256 function 2017-02-20 22:58:33 +00:00
moneromooo-monero 4bf7849297 mlog: only silence errors for net by default, not net.* 2017-02-20 22:58:29 +00:00
moneromooo-monero d282cfcc46 core: test key images against validity domain 2017-02-20 22:58:25 +00:00
moneromooo-monero efb72e74e2 http_client: add a couple consts 2017-02-20 22:58:21 +00:00
moneromooo-monero f640512c53 Optionally query moneropulse DNS records to check for updates
It just checks and prints a message if there is a new version
for now.
2017-02-20 22:58:16 +00:00
moneromooo-monero e3cae4ae2e core: display any fork warning at startup too
This is a good time for the operator to be around and see it
2017-02-20 22:58:12 +00:00
moneromooo-monero 969ad710ba dns_utils: fix first checked DNS entry being ignored 2017-02-20 22:58:08 +00:00
moneromooo-monero 08c3f38031 util: add a vercmp function to compare version numbers
It is simple, supports simple x.y.z type numeric versions,
and does not attempt any kind of validation
2017-02-20 22:58:04 +00:00
moneromooo-monero e8a7525ceb dns_utils: factor TXT record loading code from checkpoint code 2017-02-20 22:57:57 +00:00
moneromooo-monero c32830937c tx_pool: revert template filling changes
They are not ready yet
2017-02-20 22:43:37 +00:00
moneromooo-monero 5a3b1e983c wallet2: fix failure to send (relatedness check in wrong case)
A relatedness check was meant to be done in the case of adding
an extra output if just one was enough. This was mistakenly
added to the "preferred output" case.
2017-02-19 09:31:54 +00:00
moneromooo-monero 26bd7aac03 wallet_api: fix logging init via api 2017-02-18 20:44:23 +00:00
moneromooo-monero 83ec209f42 simplewallet: validate hex input size 2017-02-14 19:45:46 +00:00
moneromooo-monero a427235e30 core: add a missing newline on a string to be logged 2017-02-14 19:14:41 +00:00
moneromooo-monero b6a2230e6f unit_tests: fix minor blockchain_db regression
Due to the change in ordering for adding block and tx data
to the database in f2986ccfc1,
adding a block twice now throws TX_EXISTS, not BLOCK_EXISTS.
2017-02-14 18:56:42 +00:00
moneromooo-monero c488eca5e8 hardfork: tone down some logs 2017-02-14 18:56:39 +00:00
moneromooo-monero 9925edcb1e rpc: fix some RPC calls not returning OK status when needed 2017-02-13 23:50:10 +00:00
moneromooo-monero b560ed4ac6 daemon: silence spurious warning about uninitialized variable
Also fixes a leak
2017-02-13 22:39:25 +00:00
moneromooo-monero 0288310e3b blockchain_db: add "raw" blobdata getters for block and transaction
This speeds up operations such as serving blocks to syncing peers
2017-02-13 21:11:37 +00:00
moneromooo-monero 53f040445f cryptonote_protocol: tweaks to the syncing speedup
- only pause mining once we've got the lock (in practice, it'll
  already be paused by another thread if we can't get the lock
  at once though)
- do not call prepare_handle_incoming_blocks when we dismissed
  all the blocks, it only causes cleanup_handle_incoming_blocks
  to complain afterwards
2017-02-13 19:36:31 +00:00
moneromooo-monero cca95c1c7a blockchain_db: do not throw on expected partial results getting keys
When scanning for outputs used in a set of incoming blocks,
we expect that some of the inputs in their transactions will
not be found in the blockchain, as they could be in previous
blocks in that set. Those outputs will be scanned there at
a later point. In this case, we add a flag to control wehther
an output not being found is expected or not.
2017-02-13 19:05:30 +00:00
moneromooo-monero d43fde8a9b network_throttle: demote spammy logs to TRACE 2017-02-13 16:54:45 +00:00
moneromooo-monero 59c9d165f8 tests: fixup include paths after cryptonote_core split 2017-02-12 21:47:39 +00:00
moneromooo-monero 882db8e9d9 tools: log to the correct file 2017-02-12 19:39:59 +00:00
moneromooo-monero 142e5e1eb4 tools: set requested log level
also move a couple logs from INFO to DEBUG
2017-02-12 18:48:39 +00:00
moneromooo-monero 8bdc86beb4 protocol: speed up sync by minimizing duplicate work
In particular, the prepare_handle_incoming_blocks call
is pretty lengthy, and entirely pointless in the common
case where several different connections will prepare
the exact same blocks.
2017-02-12 17:17:30 +00:00
moneromooo-monero 61dfa310d7 epee: fix some log macros not printing context nicely 2017-02-12 17:16:11 +00:00
moneromooo-monero 8ec2a8d2b0 net_node: fix spurious warning about using uninitialized data
This is only used to load, not save
2017-02-12 14:06:36 +00:00
moneromooo-monero 422ecc98e4 Fixup choice of easylogging++ vs libunwind stack trace code 2017-02-12 13:59:21 +00:00
moneromooo-monero 5adcb5a48c tx_pool: add a debug message when adding a tx to the pool 2017-02-12 12:33:48 +00:00
moneromooo-monero 9faef1f83a cryptonote_protocol: misc fluffy block fixes
- fix wrong block being used when a new block is received between
  a node elaying a fluffy block and sending a new fluffy block
  with txes a peer did not have
- misc a neverending ping pong requesting the same missing txids
  when a new block is received in the meantime, causing the top
  block to not be the one we need
- send the original fluffy block message block height when sending
  a new fluffy block, not the current top height, which might
  have been updated since
- avoid sending back the whole block blob when asking for txes,
  send only the hash instead
- plus misc cleanup and additional debugging logs
2017-02-12 12:33:45 +00:00
moneromooo-monero 3b6839cc96 mlog: move log level changes to global level
Makes it more likely to show up
2017-02-12 11:45:22 +00:00
moneromooo-monero 38a1b9c956 rpc: fix daemon mixed style set_log 2,category:level 2017-02-12 11:37:09 +00:00
moneromooo-monero 28d0b11fde mlog: s/Mew/New/ in log 2017-02-12 11:35:04 +00:00
moneromooo-monero cf2e75ebb3 daemon: fix crash on exit when mining
When exiting while the miner is running, finding a block after
the p2p layer has been shutdown will cause a crash as the now
uninitialized p2p layer is asked to relay the found block to
any peers.
2017-02-12 11:09:21 +00:00
moneromooo-monero f2986ccfc1 db_lmdb: fix bad height saved in tx data
The recent change to not keep separate track of the blockchain
height caused the reported height to jump early in the lmdb
transaction (when the block data is added to the blocks table),
rather than at the end, after everything succeeded. Since the
block data is added before the transaction data, this caused
the transaction data to be saved with a height one more than
its expected value.

Fix this by saving the block data last. This should have no
side effects.
2017-02-11 10:16:18 +00:00
moneromooo-monero 7403e56fb4 performance_tests: report small time per call in microseconds
This is to not report quick operations as 0 milliseconds
2017-02-10 22:56:34 +00:00
moneromooo-monero cadada2d65 performance_tests: add tests for sc_reduce32 and cn_fast_hash 2017-02-10 18:45:18 +00:00
moneromooo-monero 962c72b624 performance_tests: initialize logging at startup 2017-02-10 18:44:47 +00:00
moneromooo-monero bceaf4b788 wallet2: fix transactions not considering rct inputs
I broke this very recently in 2bf029be17
and didn't notice in time
2017-02-06 20:20:22 +00:00
moneromooo-monero 1c782a923d easylogging++: do not disable DEBUG level based on _DEBUG/NDEBUG 2017-02-05 12:47:53 +00:00
moneromooo-monero 92978b2c0f common: fix link error on at least one platform (no clue which one)
Bug and fix reported by tdprime
2017-02-05 10:55:55 +00:00
moneromooo-monero cbdfa7576a mlog: fix default logging being not verbose enough 2017-02-04 12:43:19 +00:00
moneromooo-monero cd34fc655d Use easylogging++'s stack trace facility where possible
This avoids using libunwind, which often causes trouble.
2017-02-04 12:33:03 +00:00
moneromooo-monero c3d7a198bf mlog: probable fix for gmtime_r not being available on windows 2017-02-04 11:48:58 +00:00
moneromooo-monero 4f5b130de9 wallet_rpc_server: add address book RPC calls 2017-02-04 11:40:49 +00:00
moneromooo-monero 3471907160 simplewallet: cleanup
Remove empty static function which was refactored, as well as
leftover exception testing code.
2017-02-02 20:56:53 +00:00
moneromooo-monero a9a9b64b13 simplewallet: fix build (unqualified type not in current scope) 2017-02-02 20:56:31 +00:00
moneromooo-monero b5cb8861c7 core: fix integrated addresses breaking with auto zero change
Zero change is sent to a random address, which confuses the code
which determines which key to use to encrypt the payment id.
Ignore zero amounts for this purpose, so the payment id gets
encrypted with the real destination's key.
2017-02-02 20:53:12 +00:00
moneromooo-monero 8c8482ac98 wallet_rpc_server: fix short payment id validation in transfer 2017-01-29 16:10:20 +00:00
moneromooo-monero 2bf029be17 wallet2: fix corner case failing to send a second output
If a rct transaction can be made with just one input, a second
output will be added. This output will be the smallest amount
output available. However, if this output is a non rct output
with less available fake outs than requested, the transaction
will be rejected. We now check the histogram to only consider
outputs with enough available fake outs in the first place.
2017-01-28 15:07:15 +00:00
moneromooo-monero 9bd9906e8f Factor is_address_local code into a tools function 2017-01-28 14:57:47 +00:00
moneromooo-monero 69d2ad3967 wallet_rpc_server: fix logs going to the wrong file 2017-01-28 11:37:21 +00:00
moneromooo-monero 3ae79a59e4 core: set missing verifivation_failed flag when rejecting a tx
This fixes two core rct tests
2017-01-28 09:43:41 +00:00
moneromooo-monero ea6549e9da core_tests: decrease trace level from trace to debug
It had become very, very spammy
2017-01-28 09:43:32 +00:00
moneromooo-monero a39cd745c9 rpc: fix bc_dyn_stats not setting grace blocks
This caused a random value to be used, and the resulting
incorrect fee when it wasn't 0.
2017-01-23 19:28:00 +00:00
moneromooo-monero 1e8cc6764e mlog: allow using numerical level as default prefix
eg, 2,foo:ERROR,bar:INFO
2017-01-22 16:54:17 +00:00
moneromooo-monero 8028b5324e protocol: log received messages in a separate category
Makes it easier to log just what's going on on P2P
2017-01-22 16:54:10 +00:00
moneromooo-monero f098989396 core: cache tx hashes of failing semantics txes 2017-01-22 16:13:31 +00:00
moneromooo-monero 13dd102e94 mlog: fix default level/category mapping
It was not matching the LOG_PRINT_Lx mapping for 2/3/4
2017-01-22 15:20:55 +00:00
moneromooo-monero 20f7152769 wallet2: fix sending a rct tx with a single output available
This would have tried to send a second output to make the tx
look like the 2/2 ideal, but it would not fail to find one
because picking an output from preferred_inputs priority list
did not remove it from the unused tranfer/dust outputs, so
it would try to send the same output twice.

While there, I also added a check to avoid sending a second
input if it's related to the first. Better 1/2 than linking
inputs, I think.
2017-01-22 15:16:45 +00:00
moneromooo-monero b70ab128fc rpc: fix orphan_status when getting blocks
It was always set to false, even for orphan blocks
2017-01-22 12:20:55 +00:00
moneromooo-monero 4cdf0a35c9 p2p: always recreate a new peer id on startup
This prevents easy fingerprinting when you change IPs, and
will be a must when kovri gets used.
2017-01-22 11:37:55 +00:00
moneromooo-monero f9293b69d8 unit_tests: fix missing return after batch_start prototype change 2017-01-21 21:51:07 +00:00
moneromooo-monero f8b97aef34 p2p: show ban/unban logs by default again 2017-01-21 21:19:21 +00:00
moneromooo-monero 7c3f79cb9f core: early out in handle_incoming_tx if already in pool or blockchain 2017-01-21 20:30:10 +00:00
moneromooo-monero 6cc7d26140 ringct: reorder a bit to check quicker tests first 2017-01-21 20:29:22 +00:00
moneromooo-monero a854cec3ba Make stack trace show up in log file with default settings 2017-01-21 20:28:18 +00:00
moneromooo-monero 17246d051d wallet: print exception message on get_random_outs_error 2017-01-20 18:01:13 +00:00
moneromooo-monero 7c0c5c1724 easylogging++: detect DragonFly BSD as a UNIX 2017-01-20 00:33:13 +00:00
moneromooo-monero 87c658f83b wallet2_api: add API to set log categories 2017-01-16 21:14:44 +00:00
moneromooo-monero 5e61687fdf mlog: allow overriding log format
using the MONERO_LOG_FORMAT environment variable.

Default is:
%datetime{%Y-%M-%d %H:%m:%s.%g}\t%thread\t%level\t%logger\t%loc\t%msg

Field list in easylogging++ documentation.

Don't forget to escape as needed.
2017-01-16 19:43:00 +00:00
moneromooo-monero 5161f16f4a easylogging++: enforce recursive mutex
This fixes a hang when logging something which causes some other
logging code to be called
2017-01-16 19:41:17 +00:00
moneromooo-monero a480bf6b14 fixups in logging init calls, and add missing net context in a log 2017-01-16 10:45:59 +00:00
moneromooo-monero 693c190881 wallet: add a node RPC cache layer for simple RPC calls
Mostly getinfo and get_hard_fork_info, which are called
pretty often. This speeds up transfers as a bonus.
2017-01-16 08:59:15 +00:00
moneromooo-monero d86ae2bec6 wallet2: reuse fake outs when adjusting fee on transfer
This avoids indirectly leaking the real output to the daemon,
and is faster.

This will still happen for more complex cases, especially
when cancelling a tx and "re-rolling" it.
2017-01-16 08:59:08 +00:00
moneromooo-monero 64da0983d5 core: don't try to deserialize an empty extra to remove a field 2017-01-16 08:59:02 +00:00
moneromooo-monero e389bd9e60 Makefile: remove mistakenly added local custom target 2017-01-16 08:49:28 +00:00
moneromooo-monero 5833d66f65 Change logging to easylogging++
This replaces the epee and data_loggers logging systems with
a single one, and also adds filename:line and explicit severity
levels. Categories may be defined, and logging severity set
by category (or set of categories). epee style 0-4 log level
maps to a sensible severity configuration. Log files now also
rotate when reaching 100 MB.

To select which logs to output, use the MONERO_LOGS environment
variable, with a comma separated list of categories (globs are
supported), with their requested severity level after a colon.
If a log matches more than one such setting, the last one in
the configuration string applies. A few examples:

This one is (mostly) silent, only outputting fatal errors:

MONERO_LOGS=*:FATAL

This one is very verbose:

MONERO_LOGS=*:TRACE

This one is totally silent (logwise):

MONERO_LOGS=""

This one outputs all errors and warnings, except for the
"verify" category, which prints just fatal errors (the verify
category is used for logs about incoming transactions and
blocks, and it is expected that some/many will fail to verify,
hence we don't want the spam):

MONERO_LOGS=*:WARNING,verify:FATAL

Log levels are, in decreasing order of priority:
FATAL, ERROR, WARNING, INFO, DEBUG, TRACE

Subcategories may be added using prefixes and globs. This
example will output net.p2p logs at the TRACE level, but all
other net* logs only at INFO:

MONERO_LOGS=*:ERROR,net*:INFO,net.p2p:TRACE

Logs which are intended for the user (which Monero was using
a lot through epee, but really isn't a nice way to go things)
should use the "global" category. There are a few helper macros
for using this category, eg: MGINFO("this shows up by default")
or MGINFO_RED("this is red"), to try to keep a similar look
and feel for now.

Existing epee log macros still exist, and map to the new log
levels, but since they're used as a "user facing" UI element
as much as a logging system, they often don't map well to log
severities (ie, a log level 0 log may be an error, or may be
something we want the user to see, such as an important info).
In those cases, I tried to use the new macros. In other cases,
I left the existing macros in. When modifying logs, it is
probably best to switch to the new macros with explicit levels.

The --log-level options and set_log commands now also accept
category settings, in addition to the epee style log levels.
2017-01-16 00:25:46 +00:00
moneromooo-monero dc98019b59 easylogging++: fix logging with static const header only data members 2017-01-16 00:18:21 +00:00
moneromooo-monero 3b46617bd9 easylogging++: add ELPP_DISABLE_CHECK_MACROS 2017-01-16 00:18:17 +00:00
moneromooo-monero 6fe39d9017 easylogging++: allow clipping a common filename prefix 2017-01-16 00:18:12 +00:00
moneromooo-monero 43abf6ff45 easylogging++: add file-only logs 2017-01-16 00:18:07 +00:00
moneromooo-monero c313bea450 eayslogging++: Fix bad memory access before opening any files 2017-01-16 00:18:02 +00:00
moneromooo-monero 0af5d16872 easylogging++: avoid creating directory/filename for the builtin default log file 2017-01-16 00:17:59 +00:00