Commit graph

55 commits

Author SHA1 Message Date
Doyle 22e51bca1c LNS: Lowercase names at the boundary between LNS and user code 2020-03-13 13:46:45 +11:00
Doyle 291ba112b4 enum_top, use burn hf in sanity check, fill new construction data 2019-12-04 15:17:55 +11:00
Jason Rhinelander d66e6e9e3f Align hashable data structures
We don't impose any alignment on hashable types, but this means the
hashing function is doing invalid misaligned access when converting to a
size_t.  This aligns all of the primitive data types (crypto::hash,
public keys, etc.) to the same alignment as size_t.

That cascades into a few places in epee which only allow byte spanning
types that have byte alignment when what it really requires is just that
the type has no padding.  In C++17 this is exactly the purpose of
std::has_unique_object_representations, but that isn't available (or
even implementable) in C++14 so add specializations for the type that
need it to tell epee that we know those types are properly packed and
that it can safely use them as bytes.

Related to this, monero/epee also misuses `is_standard_layout` when the
purpose is actually `is_trivially_copyable`, so fixed that too.  (You
need the latter but don't need the former for a type to be safely
memcpy'able; the only purpose of `is_standard_layout` is when you need
to be sure your structs are compatible with C structs which is
irrelevant here).
2019-11-27 14:07:52 -04:00
Jason Rhinelander 4522a7ae58 Add & use tools::enum_count to get _count as underlying type
Unify the field we use to store the count as `_count` (using the leading
underscore to indicate a private value rather than an intended enum
value) and add/use a new `enum_count` template variable to extract the
_count enum value and cast it to the enum's underlying_type.
2019-11-27 14:07:52 -04:00
Jason Rhinelander f32e910d41 Add helper function to memcpy multiple variables
Lets you write `memcpy_le(dest, foo, bar, baz)` and memcpy the contents
of foo, bar, and baz sequentially.  Additionally, if any of those three
are integers, they are converted to little-endian order.
2019-10-07 22:09:17 -03:00
Doyle 4778d862c9 Merge commit 'bd42903' into LokiMergeUpstream 2019-04-12 18:37:56 +10:00
Doyle aded2cef69 Merge commit '1ed6441' into LokiMergeUpstream 2019-04-12 17:44:20 +10:00
Doyle 892469ded1 Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
Riccardo Spagni 19e37c05d6
Merge pull request #5367
07b716bf util: name replace_file arguments better (moneromooo-monero)
2019-04-11 12:41:55 +02:00
moneromooo-monero 07b716bfea
util: name replace_file arguments better
It was confusing unless you read code and the rename(2) man page.
2019-03-29 16:32:00 +00:00
rbrunner7 c23ea7962d New interactive daemon command 'print_net_stats': Global traffic stats 2019-03-24 16:58:57 +01:00
Doyle 0b6a7706ac
Add rpc call for request stake unlock (#490) 2019-03-14 07:26:38 +00:00
binaryFate 1f2930ce0b Update 2019 copyright 2019-03-05 22:05:34 +01:00
rbrunner7 1ebcd7b9b0 MMS (Multisig Messaging System): Initial version 2018-12-12 21:49:20 +01:00
moneromooo-monero 177a9d76f9
wallet: warn if lockable memory limit is too low 2018-11-03 20:09:28 +00:00
moneromooo-monero c774392985
spawn: close all file descriptors before execve
No need to give whatever we're calling access to what we use
2018-10-17 09:31:34 +00:00
fireice-uk 579383c26b simplewallet: Add Unicode input_line [Ryo backport] 2018-09-19 13:39:01 +01:00
p8p 9d6539923e
is_hdd update 2018-08-25 04:31:22 -07:00
luigi1111 1d2c08610b
Merge pull request #4136
4307489 wallet: disable core dumps on startup in release mode (moneromooo-monero)
2018-08-15 17:15:49 -05:00
moneromooo-monero 4307489147
wallet: disable core dumps on startup in release mode 2018-08-12 16:28:10 +00:00
moneromooo-monero 639ca3b1fa
core_tests: add --filter to select which tests to run 2018-07-07 19:33:35 +01:00
stoffu 59de6f8d99
util: add file_locker class 2018-06-28 09:40:31 +09:00
stoffu 248310de06
Move parse_subaddress_lookahead() from simplewallet.cpp to util.cpp 2018-06-21 12:36:17 +09:00
moneromooo-monero 284fe6438d
db_lmdb: warn about slowness when running off a spinning disk 2018-06-08 20:59:02 +01:00
Jethro Grassie a4b50a6f51
handle ^D and ^C while password prompting 2018-02-10 18:29:49 -05:00
xmr-eric 18216f19dd Update 2018 copyright 2018-01-26 10:03:20 -05:00
iDunk5400 fdf0acbf97
Tools, daemonizer: fix building on Windows 2017-11-15 23:12:02 +01:00
Riccardo Spagni f26e7a84a6
Merge pull request #2620
6bd4dac6 util: ignore SIGPIPE (moneromooo-monero)
2017-11-14 14:54:42 +02:00
moneromooo-monero 7130cf0c61
Add tools::on_startup, and warn about glibc 2.25 bug if found
https://sourceware.org/bugzilla/show_bug.cgi?id=21778
2017-10-14 09:12:28 +01:00
moneromooo-monero 6bd4dac6e2
util: ignore SIGPIPE
In practice, this seems to cause monero-wallet-rpc to exit
when ^C quits whatever its output is piped into (such as tee),
but it saves, while it did not before.
2017-10-09 21:46:01 +01:00
Lee Clagett 9c83f8063d Do not create file when RPC user/pass is given and use file locking 2017-08-30 17:39:59 -04:00
moneromooo-monero 06aea2cf0a
move get_proof_of_trust_hash from util.h to p2p_protocol_defs.h
This avoids having to include p2p_protocol_defs.h in util.h,
as util.h is used a lot, and p2p_protocol_defs.h includes
a lot of other things that most users don't need.
2017-07-27 15:46:47 +01:00
moneromooo-monero 583a7b5c74
core: protect precomputed block hashes with SHA256 2017-02-23 23:18:10 +00:00
Riccardo Spagni c3599fa7b9
update copyright year, fix occasional lack of newline at line end 2017-02-21 19:38:18 +02:00
moneromooo-monero 216f062eb8
util: add a SHA256 function 2017-02-20 22:58:33 +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 9bd9906e8f
Factor is_address_local code into a tools function 2017-01-28 14:57:47 +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 1976eddd89
common: add missing #include <system_error> for std::error_code 2016-12-20 18:53:58 +00:00
Lee Clagett 427054c3d5 Enabled HTTP auth support for monero-wallet-rpc 2016-12-16 23:59:46 -05:00
moneromooo-monero 513a658c87
add a --max-concurrency flag
It sets the max number of threads to use for a parallel job.
This is different that the number of total threads, since monero
binaries typically start a lot of them.
2016-04-28 20:33:59 +01:00
moneromooo-monero 7385c036bd
util: add a function to set umask to 077
Useful to ensure files are written without group/other read rights.
2016-04-06 19:59:34 +01:00
Howard Chu b937a2c915 Use boost::thread instead of std::thread
and all other associated IPC
2016-03-11 15:09:50 +00:00
Riccardo Spagni de03926850
updated copyright year 2015-12-31 08:39:56 +02:00
moneromooo-monero d68a63e404
wallet: cancellable refresh
^C while in manual refresh will cancel the refresh, since that's
often an annoying thing to have to wait for. Also, a manual refresh
command will interrupt any running background refresh and take
over, rather than wait for the background refresh to be done, and
look to be hanging.
2015-11-29 23:24:56 +00:00
moneromooo-monero f3724aef88
Fix startup crash when using a locale boost does not like
There are various locale related bugs in various versions of boost,
where exceptions are thrown in boost::filesystem APIs when the
current locale is not to boost's liking. It's not clear what "not
to boost's liking" means in detail, though "en" and "en_US.UTF-8"
are not to its liking.

Fix it by running a test function that's known to throw in such
a case, and resetting LANG and LC_ALL to C if an exception is
thrown. In simplewallet, the locale is queried before that so the
correct translations will still be used.
2015-11-21 10:13:10 +00:00
Thomas Winget 2b0583b2c6
Hopefully fixes build on Windows 2015-03-20 16:40:54 -04:00
Riccardo Spagni f4b69d553a
year updated in license 2015-01-02 18:52:46 +02:00
jebes f7900ccfc1 mispelled brief, corrected it 2014-09-11 10:36:39 -04:00
jebes a70bf86037 Documented varint 2014-09-11 10:14:05 -04:00