Commit Graph

2380 Commits

Author SHA1 Message Date
Miguel Herranz
0644eed772 Remove boost/foreach.cpp includes 2017-01-22 23:31:34 +01:00
=
e92c4fff1a
Wallet api: testnet getter 2017-01-22 23:02:01 +01:00
Miguel Herranz
36dd3e238f Replace BOOST_REVERSE_FOREACH with ranged for 2017-01-22 21:47:39 +01:00
Miguel Herranz
629e3101ab Replace BOOST_FOREACH with C++11 ranged for 2017-01-22 21:38:10 +01: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
Riccardo Spagni
9c06a7fd04
Merge pull request #1615
f0989893 core: cache tx hashes of failing semantics txes (moneromooo-monero)
2017-01-22 11:51:53 -05:00
Riccardo Spagni
17247b23bf
Merge pull request #1612
20f71527 wallet2: fix sending a rct tx with a single output available (moneromooo-monero)
2017-01-22 11:49:20 -05:00
Riccardo Spagni
a3de797e57
Merge pull request #1610
b70ab128 rpc: fix orphan_status when getting blocks (moneromooo-monero)
2017-01-22 11:48:39 -05:00
Riccardo Spagni
add98edfc3
Merge pull request #1609
4cdf0a35 p2p: always recreate a new peer id on startup (moneromooo-monero)
2017-01-22 11:47:43 -05:00
Riccardo Spagni
f798a2ab85
Merge pull request #1606
f8b97aef p2p: show ban/unban logs by default again (moneromooo-monero)
2017-01-22 11:43:11 -05:00
Riccardo Spagni
ee45b7a6db
Merge pull request #1605
7c3f79cb core: early out in handle_incoming_tx if already in pool or blockchain (moneromooo-monero)
6cc7d261 ringct: reorder a bit to check quicker tests first (moneromooo-monero)
2017-01-22 11:42:15 -05:00
Riccardo Spagni
e12f073f65
Merge pull request #1604
a854cec3 Make stack trace show up in log file with default settings (moneromooo-monero)
2017-01-22 11:41:38 -05:00
moneromooo-monero
f098989396
core: cache tx hashes of failing semantics txes 2017-01-22 16:13:31 +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
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
Miguel Herranz
1c4d65c011 Rename method to get_random_gray_peer 2017-01-21 13:04:49 +01:00
Miguel Herranz
03a54ee0c9 Fix logging that broke after rebasing 2017-01-21 11:22:04 +01:00
Miguel Herranz
6bdd3a59b5 Use set_peer_just_seen to keep last_seen updated 2017-01-21 10:11:32 +01:00
Miguel Herranz
82dbeedd1b Add gray peer list housekeeping system
A random peer from the gray peer list is selected and a connection is
made to check if the peer is alive.

If the connection and handshake are successful the peer is promoted to
the white peer list, in case of failure the peer is evicted from the
gray peer list.

The connection is closed after the check in either case.
2017-01-21 10:09:38 +01:00
Riccardo Spagni
39aaea8e62
Merge pull request #1599
17246d05 wallet: print exception message on get_random_outs_error (moneromooo-monero)
2017-01-20 21:00:01 -05:00
Riccardo Spagni
3db3a6ee1a
Merge pull request #1593
cbcdf8ad Honor depth in get_peerlist_head method (Miguel Herranz)
2017-01-20 20:59:09 -05:00
Riccardo Spagni
4bcd284c76
Merge pull request #1592
78d560a9 simplewallet: use MAKE_CORE_RPC_VERSION(1,4) instead of 0x10004 (kenshi84)
2017-01-20 20:58:55 -05:00
Riccardo Spagni
d5fbba45e8
Merge pull request #1589
87c658f8 wallet2_api: add API to set log categories (moneromooo-monero)
2017-01-20 20:58:39 -05:00
Riccardo Spagni
8698dd36f2
Merge pull request #1587
843769f8 Tweak some msg loglevels (Howard Chu)
2017-01-20 20:56:47 -05:00
Riccardo Spagni
d10425025a
Merge pull request #1572
0e0e6c5f Reduce to one connection per IP (Miguel Herranz)
3f269e98 Limit incoming connections from the same IP (Miguel Herranz)
2017-01-20 20:54:04 -05:00
moneromooo-monero
17246d051d
wallet: print exception message on get_random_outs_error 2017-01-20 18:01:13 +00:00
Miguel Herranz
cbcdf8ad35 Honor depth in get_peerlist_head method
The method returned depth + 2 because:

- push_back was executed before the condition.
- > instead of >= causing one more iteration.
2017-01-18 21:41:52 +01:00
kenshi84
78d560a933 simplewallet: use MAKE_CORE_RPC_VERSION(1,4) instead of 0x10004 2017-01-18 16:11:18 +09:00
moneromooo-monero
87c658f83b
wallet2_api: add API to set log categories 2017-01-16 21:14:44 +00:00
Howard Chu
843769f88f
Tweak some msg loglevels 2017-01-16 20:42:59 +00:00
Miguel Herranz
0e0e6c5f39 Reduce to one connection per IP 2017-01-16 18:16:32 +01:00
Riccardo Spagni
71ac698b78
Merge pull request #1585
a480bf6b fixups in logging init calls, and add missing net context in a log (moneromooo-monero)
2017-01-16 08:41:33 -05:00
Riccardo Spagni
deb6728bc3
Merge pull request #1584
990e08f0 Fix PR#1506, off by one in chain height (Howard Chu)
2017-01-16 08:41:15 -05: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
Howard Chu
990e08f090
Fix PR#1506, off by one in chain height 2017-01-16 10:00:06 +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
Riccardo Spagni
ab69d5b367
Merge pull request #1569
16b8b66a specify restore height by YYYY-MM-DD format (kenshi84)
2017-01-15 20:32:57 -05:00
kenshi84
16b8b66adc specify restore height by YYYY-MM-DD format 2017-01-16 10:00:28 +09: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
Riccardo Spagni
e459d8604d
Merge pull request #1578
ce866d1c macro to define core RPC version for avoiding future mistake (kenshi84)
2017-01-15 19:13:45 -05:00
Riccardo Spagni
422a36ca2a
Merge pull request #1581
6da9335a blockchain_import: fix build after tx_pool::add_tx changes (moneromooo-monero)
2017-01-15 19:13:28 -05:00
Riccardo Spagni
ec323d8c3f
Merge pull request #1561
d561f4ad enable clang checks that were disabled (Chris Vickio)
0aefb2f6 remove std::move from return statements (pessimizing-move warning) (Chris Vickio)
629d5b76 change counter from bool to int (deprecated-increment-bool warning) (Chris Vickio)
fb76d439 add extra braces around subobjects (missing-braces warning) (Chris Vickio)
3b6d5f25 make struct/class declarations consistent (mismatched-tags warning) (Chris Vickio)
fcf66925 remove unused fields from network_throttle (unused-private-field warning) (Chris Vickio)
296f8c16 inline unused function (for unused-function warning) (Chris Vickio)
2017-01-15 19:01:08 -05:00
kenshi84
ce866d1cc6 macro to define core RPC version for avoiding future mistake 2017-01-16 07:55:43 +09:00
moneromooo-monero
6da9335a9e
blockchain_import: fix build after tx_pool::add_tx changes 2017-01-15 21:52:56 +00:00
Riccardo Spagni
b2e1568335
Merge pull request #1579
f5f4109f mnemonics: fix language detection with checksum word (moneromooo-monero)
2017-01-15 14:58:09 -05:00
Riccardo Spagni
99ffc49740
Merge pull request #1577
feb499aa core: check block version for alt chains too (moneromooo-monero)
2017-01-15 14:57:30 -05:00
Riccardo Spagni
1207d8ad0d
Merge pull request #1576
ba3968f6 rct: split rct checks between semantics and other (moneromooo-monero)
2017-01-15 14:56:39 -05:00
Riccardo Spagni
9cda94d0aa
Merge pull request #1574
d276a165 wallet2: use at least two rct inputs if possible (moneromooo-monero)
2017-01-15 14:55:40 -05:00
Riccardo Spagni
f00797a1f2
Merge pull request #1573
dea53962 fix timeout in check_connection (Jaquee)
2017-01-15 14:55:12 -05:00
Riccardo Spagni
10c6afd316
Merge pull request #1571
81c384e4 fix do_not_relay not preventing relaying on a timer (moneromooo-monero)
2017-01-15 14:50:10 -05:00
Riccardo Spagni
91083a43be
Merge pull request #1568
5b5017e2 rpc: add a command to get info about the current blockchain (moneromooo-monero)
2017-01-15 14:48:09 -05:00
Riccardo Spagni
31de98793f
Merge pull request #1567
c9f13c5e wallet2: fix tx reroll not updating fee is going up a kB step (moneromooo-monero)
2017-01-15 14:47:44 -05:00
Riccardo Spagni
51baab2112
Merge pull request #1565
50b230d1 core: ensure block size limit is set from the start (moneromooo-monero)
2017-01-15 14:47:17 -05:00
Riccardo Spagni
865f5bef34
Merge pull request #1564
1d317981 Wallet API: add key image import/export functions (Jaquee)
2017-01-15 14:46:52 -05:00
Riccardo Spagni
8bd2c2e551
Merge pull request #1563
36ba311c Prioritize older transactions in the mempool (Miguel Herranz)
2017-01-15 14:46:33 -05:00
Riccardo Spagni
935f50471c
Merge pull request #1560
46550c0b Wallet API: add rescanSpent() (Jaquee)
2017-01-15 14:44:49 -05:00
Riccardo Spagni
c23bd75df6
Merge pull request #1552
4a017674 Wallet API: support integrated addresses in address book. (Jaquee)
2017-01-15 14:44:28 -05:00
Riccardo Spagni
65e33b1bc5
Merge pull request #1506
3ff54bdd Check for correct thread before ending batch transaction (Howard Chu)
eaf8470b Must wait for previous batch to finish before starting new one (Howard Chu)
c903c554 Don't cache block height, always get from DB (Howard Chu)
eb1fb601 Tweak default db-sync-mode to fast:async:1 (Howard Chu)
0693cff9 Use batch transactions when syncing (Howard Chu)
2017-01-15 14:43:12 -05:00
Chris Vickio
0aefb2f60a remove std::move from return statements (pessimizing-move warning) 2017-01-15 19:23:33 +03:00
Chris Vickio
629d5b7689 change counter from bool to int (deprecated-increment-bool warning) 2017-01-15 19:23:33 +03:00
Howard Chu
3ff54bdd7a
Check for correct thread before ending batch transaction 2017-01-15 15:51:57 +00:00
moneromooo-monero
f5f4109f9a
mnemonics: fix language detection with checksum word
If a checksum word is present, language detection would use
just the word prefixes. However, a set of word prefixes may
be found in more than one language, and so the wrong language
may be found first, which could then fail the checksum, since
the check may be done with a different unique prefix length
from the one it was created from.

We now make a checksum test when we we detect a language from
prefixes only, to make sure we have the correct one.
2017-01-15 11:16:25 +00:00
Miguel Herranz
3f269e988c Limit incoming connections from the same IP 2017-01-15 12:11:27 +01:00
Howard Chu
eaf8470b29
Must wait for previous batch to finish before starting new one 2017-01-14 22:43:06 +00:00
Howard Chu
c903c5541e
Don't cache block height, always get from DB 2017-01-14 22:43:06 +00:00
Howard Chu
eb1fb6011a
Tweak default db-sync-mode to fast:async:1
fsync the DB asynchronously, to allow block download/verification
to proceed while syncing. Sync after every batch. Note that
"fastest" still defaults to fastest:async:1000.
2017-01-14 22:43:06 +00:00
Howard Chu
0693cff925
Use batch transactions when syncing
Faster throughput while avoiding corruption. I.e., makes
running with --db-sync-mode safe more tolerable.
2017-01-14 22:43:06 +00:00
moneromooo-monero
feb499aaae
core: check block version for alt chains too
This is incompatible with block version voting
2017-01-14 22:41:14 +00:00
moneromooo-monero
d276a16526
wallet2: use at least two rct inputs if possible
If we'd make a rct tx with just one input, we try to add
a second one to match the 2/2 ideal. This means more txes
use that template (and are thus using a larger anonymity
set), and it coalesces outputs "for free". We use the
smallest amount outputs in priority for this, so we can
"clean" the wallet at the same time.
2017-01-14 21:43:01 +00:00
moneromooo-monero
ba3968f6ce
rct: split rct checks between semantics and other
Semantics can be checked early
2017-01-14 21:17:32 +00:00
Jaquee
dea53962a3
fix timeout in check_connection 2017-01-14 14:45:30 +01:00
moneromooo-monero
81c384e408
fix do_not_relay not preventing relaying on a timer
Also print its value when printing pool
2017-01-14 13:07:05 +00:00
Chris Vickio
fb76d43980 add extra braces around subobjects (missing-braces warning) 2017-01-14 15:06:07 +03:00
Chris Vickio
3b6d5f255d make struct/class declarations consistent (mismatched-tags warning) 2017-01-14 15:06:07 +03:00
Chris Vickio
fcf66925c1 remove unused fields from network_throttle (unused-private-field warning) 2017-01-14 15:06:07 +03:00
moneromooo-monero
5b5017e267
rpc: add a command to get info about the current blockchain
About the tip of the main chain, and the last N blocks
2017-01-13 23:21:38 +00:00
moneromooo-monero
c9f13c5e54
wallet2: fix tx reroll not updating fee is going up a kB step 2017-01-13 22:28:19 +00:00
moneromooo-monero
176b70a0d4
account: fix build error involving std::max and different types 2017-01-13 22:12:27 +00:00
Jaquee
1d3179816b
Wallet API: add key image import/export functions 2017-01-13 23:02:20 +01:00
Jaquee
4a0176740d
Wallet API: support integrated addresses in address book. 2017-01-13 22:41:17 +01:00
moneromooo-monero
50b230d12c
core: ensure block size limit is set from the start
It can now be queried by RPC, so it needs to be set before
it is otherwise needed for consensus, even if no blocks had
to be added (ie, exit and restart quickly).
2017-01-13 21:06:14 +00:00
Jaquee
46550c0b4f
Wallet API: add rescanSpent() 2017-01-13 22:05:39 +01:00
Riccardo Spagni
2806842200
Merge pull request #1562
a081b39c Move key image export/import functions to wallet2 (Jaquee)
2017-01-13 14:38:29 -05:00
Riccardo Spagni
2a2f02e375
Merge pull request #1559
db56a03f Wallet2 + API: Callbacks for unconfirmed transfers (Jaquee)
2017-01-13 14:37:12 -05:00
Riccardo Spagni
cbb39b499b
Merge pull request #1558
7961878e initialize timestamp to 0 and check for mktime() error (Chris Vickio)
2017-01-13 14:36:42 -05:00
Riccardo Spagni
e75fd059dd
Merge pull request #1555
758c0eb7 fix time stats mixin (luigi1111)
2017-01-13 14:36:24 -05:00
Riccardo Spagni
433adee594
Merge pull request #1545
5ae00f0f add msg for donate (luigi1111)
2017-01-13 14:35:34 -05:00
Riccardo Spagni
0b6031adbf
Merge pull request #1543
19be7225 Add start_time to get_info methods and show uptime (Miguel Herranz)
2017-01-13 14:35:21 -05:00
Riccardo Spagni
faa33fc326
Merge pull request #1541
0d3918e1 Wallet api: Update trustedDaemon when daemon is changed (Jaquee)
dbb838f4 GUI cold signing (Jaquee)
afb85a02 Wallet API: functions for supporting/creating view only wallets (Jaquee)
2017-01-13 14:34:55 -05:00
Riccardo Spagni
e51afeb90f
Merge pull request #1540
79b4e1f9 Cold signing: make sure short payment id isnt encrypted twice (Jaquee)
2017-01-13 14:34:26 -05:00
Riccardo Spagni
006bb0e957
Merge pull request #1538
aff28178 Remove db-auto-remove-logs (Miguel Herranz)
1229c685 Remove berkeley from db_type initialization (Miguel Herranz)
e3090558 Show available types for db-type command (Miguel Herranz)
046ab33d Remove berkeley from blockchain_db_types (Miguel Herranz)
2017-01-13 14:33:59 -05:00
Riccardo Spagni
36b84ded95
Merge pull request #1526
5eed5b05 Wallet API: functions for supporting/creating view only wallets (Jaquee)
2017-01-13 14:32:26 -05:00
Riccardo Spagni
aeeb24991a
Merge pull request #1523
d81cb087 Added (not yet enabled) HTTP client authentication (Lee Clagett)
2017-01-13 14:32:08 -05:00