Commit Graph

342 Commits

Author SHA1 Message Date
Riccardo Spagni 42adc50766
Merge pull request #5125
8298f42e miner: it can now autodetect the optimal number of threads (moneromooo-monero)
2019-03-04 21:27:16 +02:00
moneromooo 807903bbbf
hardfork: fix fork determination for historical heights 2019-03-04 11:19:59 +00:00
Riccardo Spagni 1b4fa00d7c
Merge pull request #5126
f1fb06b1 Fixed path to int-util.h (SChernykh)
9da0892b Adding cnv4-2 tweaks (SChernykh)
f51397b3 Cryptonight variant 4 aka CryptonightR (SChernykh)
2019-03-04 12:10:16 +02:00
xiphon 551104fbf1 daemon: add --public-node mode, RPC port propagation over P2P 2019-02-25 02:40:23 +03:00
moneromooo-monero 8298f42e9d
miner: it can now autodetect the optimal number of threads 2019-02-23 12:22:32 +00:00
SChernykh f51397b306 Cryptonight variant 4 aka CryptonightR
It introduces random integer math into the main loop.
2019-02-14 11:29:54 +01:00
italocoin de32dcea1d Human readable message if maximum outputs reached 2019-02-10 09:51:20 -05:00
moneromooo-monero 529645014c
ringct: fix v1 ecdhInfo serialization
The change made for v2 broke v1, and we have no way to know which
version we're serializing here. However, since we don't actually
care about space savings in this case, we continue serialiazing
both mask and amount.
2019-02-03 10:33:10 +00:00
Riccardo Spagni 0daa00e035
Merge pull request #5052
b6534c40 ringct: remove unused senderPk from ecdhTuple (moneromooo-monero)
7d375981 ringct: the commitment mask is now deterministic (moneromooo-monero)
99d946e6 ringct: encode 8 byte amount, saving 24 bytes per output (moneromooo-monero)
cdc3ccec ringct: save 3 bytes on bulletproof size (moneromooo-monero)
f931e16c add a bulletproof version, new bulletproof type, and rct config (moneromooo-monero)
2019-01-28 21:24:55 +02:00
moneromooo-monero b6534c40e6
ringct: remove unused senderPk from ecdhTuple
This was an early ringct field, which was never used in production
2019-01-22 23:17:42 +00:00
moneromooo-monero 7d37598158
ringct: the commitment mask is now deterministic
saves space in the tx and is safe

Found by knaccc
2019-01-22 23:17:39 +00:00
moneromooo-monero 99d946e619
ringct: encode 8 byte amount, saving 24 bytes per output
Found by knaccc
2019-01-22 23:17:31 +00:00
moneromooo-monero f931e16c6e
add a bulletproof version, new bulletproof type, and rct config
This makes it easier to modify the bulletproof format
2019-01-22 23:17:24 +00:00
moneromooo-monero b750fb27b0
Pruning
The blockchain prunes seven eighths of prunable tx data.
This saves about two thirds of the blockchain size, while
keeping the node useful as a sync source for an eighth
of the blockchain.

No other data is currently pruned.

There are three ways to prune a blockchain:

- run monerod with --prune-blockchain
- run "prune_blockchain" in the monerod console
- run the monero-blockchain-prune utility

The first two will prune in place. Due to how LMDB works, this
will not reduce the blockchain size on disk. Instead, it will
mark parts of the file as free, so that future data will use
that free space, causing the file to not grow until free space
grows scarce.

The third way will create a second database, a pruned copy of
the original one. Since this is a new file, this one will be
smaller than the original one.

Once the database is pruned, it will stay pruned as it syncs.
That is, there is no need to use --prune-blockchain again, etc.
2019-01-22 20:30:51 +00:00
moneromooo-monero 5ee6f03742
blockchain: fix wrong hf version when popping multiple blocks
Since we keep track of the hf version in the db, we pick it up
from there instead of doing the full reorg call, which is quite
expensive
2019-01-01 18:28:01 +00:00
moneromooo-monero 94a375d559
hardfork: remove batch transactions setup
This is now default, so it spares us the warnings
2019-01-01 18:28:01 +00:00
luigi1111 61c0083105
Merge pull request #4953
dbbb3ce cryptonote: don't serialize for blob size if already known (moneromooo-monero)
2018-12-31 16:26:22 -06:00
luigi1111 69e8567c0e
Merge pull request #4946
6644b9b blockchain_db: remove a couple unused functions (moneromooo-monero)
ce594f5 blockchain_db: allocate known size vector only once (moneromooo-monero)
8332698 db_lmdb: inline check_open, it's trivial and called everywhere (moneromooo-monero)
5511563 db_lmdb: avoid pointless division (moneromooo-monero)
d1efe3d cryptonote: set tx hash on newly parsed txes when known (moneromooo-monero)
9cc68a2 tx_pool: add a few std::move where it can make a difference (moneromooo-monero)
2018-12-31 16:06:50 -06:00
Riccardo Spagni 51874e5a40
Merge pull request #4924
0c5dd316 cryptonote: add a set_null for transaction_prefix (moneromooo-monero)
2018-12-12 12:00:50 +02:00
moneromooo-monero dbbb3ce9d8
cryptonote: don't serialize for blob size if already known 2018-12-07 14:07:26 +00:00
moneromooo-monero d1efe3d91c
cryptonote: set tx hash on newly parsed txes when known 2018-12-05 21:13:29 +00:00
Riccardo Spagni 81418cb281
Merge pull request #4894
aee7a4e3 wallet_rpc_server: do not use RPC data if the call failed (moneromooo-monero)
1a0733e5 windows_service: fix memory leak (moneromooo-monero)
0dac3c64 unit_tests: do not rethrow a copy of an exception (moneromooo-monero)
5d9915ab cryptonote: fix get_unit for non default settings (moneromooo-monero)
d4f50cb1 remove some unused code (moneromooo-monero)
61163971 a few minor (but easy) performance tweaks (moneromooo-monero)
30023074 tests: slow_memmem now returns size_t (moneromooo-monero)
2018-12-04 17:33:19 +02:00
moneromooo-monero ec1a62b50d
move int-util.h to epee 2018-12-04 15:14:29 +00:00
Riccardo Spagni e7d30780de
Merge pull request #4869
60f36386 Avoid unnecessary temp block and copy ctor (moneromooo-monero)
2018-12-04 17:12:47 +02:00
Riccardo Spagni c00ac446fd
Merge pull request #4854
bd98e99c Removed a lot of unnecessary includes (Martijn Otto)
2018-12-04 17:08:42 +02:00
moneromooo-monero 0c5dd3161b
cryptonote: add a set_null for transaction_prefix
Since it's all inline, I suspect the compiler will merge the
duplicate stores anyway.
2018-11-30 15:11:43 +00:00
moneromooo-monero 5d9915ab9e
cryptonote: fix get_unit for non default settings
Found by codacy.com
2018-11-23 15:37:39 +00:00
moneromooo-monero 611639710d
a few minor (but easy) performance tweaks
Found by codacy.com
2018-11-23 15:36:48 +00:00
moneromooo-monero 60f36386e4
Avoid unnecessary temp block and copy ctor
block already has a default ctor, and the extra object
churn due to its innards (vectors, etc) is pointless.
2018-11-19 17:57:17 +00:00
Martijn Otto bd98e99c80
Removed a lot of unnecessary includes 2018-11-15 17:29:34 +01:00
Riccardo Spagni 59e8a4c306
Merge pull request #4753
157054b8 hardfork: initialize current_fork_index in ctor (moneromooo-monero)
2362baf7 network_throttle: initialize m_last_sample_time in ctor (moneromooo-monero)
d9400f69 serializtion: add missing mainnet and stagenet fields for 0mq (moneromooo-monero)
cbe0122b wallet2: initialize amount to 0 in tx_scan_info_t ctor (moneromooo-monero)
2018-11-14 21:33:02 +02:00
Riccardo Spagni 148ac1a898
Merge pull request #4744
b3e8677c cryptonote: use logging functions for errors, not std::cout (moneromooo-monero)
2018-11-06 21:33:52 +02:00
Dusan Klinec 29ffb6bba8
device/trezor: trezor support added 2018-11-02 21:36:39 +01:00
moneromooo-monero 157054b840
hardfork: initialize current_fork_index in ctor
Also order init list to match actual runtime init order

Coverity 136605
2018-10-29 16:23:58 +00:00
moneromooo-monero b3e8677c70
cryptonote: use logging functions for errors, not std::cout 2018-10-27 18:07:55 +00:00
Riccardo Spagni 20d3605a54
Merge pull request #4700
3bb4b0d4 miner: fix build with boost 1.69 (moneromooo-monero)
2018-10-26 22:41:21 +02:00
Riccardo Spagni fc06c5daf8
Merge pull request #4617
3ffbec15 rpc: init m_rpc_version in Message ctor (moneromooo-monero)
bfa2dce1 rpc: remove unused ctors (moneromooo-monero)
7cc39845 account: init creation timestamp to 0 (moneromooo-monero)
32123789 wallet2: initialize some scalar fields in ctor where appropriate (moneromooo-monero)
4eca42b2 blockchain_db: initialize m_hardfork in ctor just in case (moneromooo-monero)
2018-10-26 22:39:00 +02:00
Riccardo Spagni 1c91963dcd
Merge pull request #4308
9907ea06 cryptonote: sort tx_extra fields (moneromooo-monero)
2018-10-26 22:18:28 +02:00
moneromooo-monero 3bb4b0d41f
miner: fix build with boost 1.69 2018-10-22 22:17:15 +00:00
Riccardo Spagni a145ae52b6
Merge pull request #4523
6ca00b6d miner: really reset flags/precision on std::cout (moneromooo-monero)
2018-10-20 20:40:36 +02:00
moneromooo-monero 7cc39845be
account: init creation timestamp to 0
Never actually used uninitialized

Coverity 136615
2018-10-16 11:58:50 +00:00
Riccardo Spagni c531df734f
Merge pull request #4389
6844ae1b tx_pool: avoid parsing a whole tx if only the prefix is needed (moneromooo-monero)
2018-10-15 13:36:15 +02:00
moneromooo-monero 6ca00b6d75
miner: really reset flags/precision on std::cout 2018-10-08 12:12:36 +00:00
moneromooo-monero 6844ae1b8d
tx_pool: avoid parsing a whole tx if only the prefix is needed 2018-10-08 10:18:01 +00:00
moneromooo-monero 9907ea0694
cryptonote: sort tx_extra fields
This removes some small amount of fingerprinting entropy.
There is no consensus rule to require this since this field
is technically free form, and a transaction is free to have
custom data in it.
2018-10-07 11:13:22 +00:00
Riccardo Spagni effcbf2060
Merge pull request #4459
bcf3f6af fuzz_tests: catch unhandled exceptions (moneromooo-monero)
3ebd05d4 miner: restore stream flags after changing them (moneromooo-monero)
a093092e levin_protocol_handler_async: do not propagate exception through dtor (moneromooo-monero)
1eebb82b net_helper: do not propagate exceptions through dtor (moneromooo-monero)
fb6a3630 miner: do not propagate exceptions through dtor (moneromooo-monero)
2e2139ff epee: do not propagate exception through dtor (moneromooo-monero)
0749a8bd db_lmdb: do not propagate exceptions in dtor (moneromooo-monero)
1b0afeeb wallet_rpc_server: exit cleanly on unhandled exceptions (moneromooo-monero)
418a9936 unit_tests: catch unhandled exceptions (moneromooo-monero)
ea7f9543 threadpool: do not propagate exceptions through the dtor (moneromooo-monero)
6e855422 gen_multisig: nice exit on unhandled exception (moneromooo-monero)
53df2deb db_lmdb: catch error in mdb_stat calls during migration (moneromooo-monero)
e67016dd blockchain_blackball: catch failure to commit db transaction (moneromooo-monero)
661439f4 mlog: don't remove old logs if we failed to rename the current file (moneromooo-monero)
5fdcda50 easylogging++: test for NULL before dereference (moneromooo-monero)
7ece1550 performance_test: fix bad last argument calling add_arg (moneromooo-monero)
a085da32 unit_tests: add check for page size > 0 before dividing (moneromooo-monero)
d8b1ec8b unit_tests: use std::shared_ptr to shut coverity up about leaks (moneromooo-monero)
02563bf4 simplewallet: top level exception catcher to print nicer messages (moneromooo-monero)
c57a65b2 blockchain_blackball: fix shift range for 32 bit archs (moneromooo-monero)
2018-09-29 22:20:38 +02:00
Riccardo Spagni b4a9ebad6c
Merge pull request #4299
f9b22a7b hw_device: support for multiple devices added [for review] (Dusan Klinec)
2018-09-18 17:29:26 +02:00
Riccardo Spagni 9c40bc62fc
Merge pull request #3430
42397359 Fixup 32bit arm build (TheCharlatan)
a06d2581 Fix Windows build (TheCharlatan)
ecaf5b3f Add libsodium to the packages, the arm build was complaining about it. (TheCharlatan)
cbbf4d24 Adapt translations to upstream changes (TheCharlatan)
db571546 Updated pcsc url (TheCharlatan)
f0ba19fd Add lrelease to the depends (TheCharlatan)
cfb30462 Add Miniupnp submodule (TheCharlatan)
5f7da005 Unbound is now a submodule. Adapt depends for this. (TheCharlatan)
d6b9bdd3 Update readmes to reflect the usage of depends (TheCharlatan)
56b6e41e Add support for apple and arm building (TheCharlatan)
29311fd1 Disable stack unwinding for mingw32 depends build. (TheCharlatan)
8db3d573 Modify depends for monero's dependencies (TheCharlatan)
0806a23a Initial depends addition (TheCharlatan)
2018-09-18 16:33:21 +02:00
Dusan Klinec f9b22a7b01
hw_device: support for multiple devices added [for review]
- device name is a new wallet property
- full device name is now a bit more structured so we can address particular device vendor + device path. Example: 'Ledger', 'Trezor:udp', 'Trezor:udp:127.0.0.1:21324', 'Trezor:bridge:usb01'. The part before ':' identifies HW device implementation, the optional part after ':' is device path to look for.
- new --hw-device parameter added to the wallet, can name the hardware device
- device reconnect added
2018-09-14 16:02:00 +02:00
Riccardo Spagni 7addabce8f
Merge pull request #4330
93e7627d cryptonote_format_utils: do not early out on invalid tx pubkeys (moneromooo-monero)
2018-09-14 13:04:40 +02:00
moneromooo-monero 044dff5a30
bulletproofs: scale points by 8 to ensure subgroup validity 2018-09-11 13:38:31 +00:00
moneromooo-monero d1591853bf
cryptonote_basic: check output type before using it
Reported by QuarksLab.
2018-09-11 13:38:15 +00:00
moneromooo-monero 5ffb2ff9b7
v8: per byte fee, pad bulletproofs, fixed 11 ring size 2018-09-11 13:38:07 +00:00
moneromooo-monero 2a8fcb421b
Bulletproof aggregated verification and tests
Also constrains bulletproofs to simple rct, for simplicity
2018-09-11 13:37:37 +00:00
TheCharlatan 56b6e41ea7 Add support for apple and arm building
Add pcsc-lite to linux builds
Fixup windows icu4c linking with depends, the static libraries have an 's' appended to them
Compiling depends arm-linux-gnueabihf will allow you to compile armv6zk monero binaries
2018-09-10 22:05:36 +02:00
moneromooo-monero 93e7627d5a
cryptonote_format_utils: do not early out on invalid tx pubkeys
Another such pubkey might be valid
2018-09-02 23:00:44 +00:00
moneromooo-monero ab74dc277a
crypto: make secret_key automatically mlock 2018-08-16 11:57:49 +00:00
moneromooo-monero e9ffa91257
store secret keys encrypted where possible
The secret spend key is kept encrypted in memory, and
decrypted on the fly when needed.

Both spend and view secret keys are kept encrypted in a JSON
field in the keys file. This avoids leaving the keys in
memory due to being manipulated by the JSON I/O API.
2018-08-16 11:57:43 +00:00
luigi1111 3235abc184
Merge pull request #4030
0c41488 miner: show id and height when a block is found (stoffu)
2018-07-19 13:53:36 -05:00
luigi1111 025187e6c9
Merge pull request #3854
149da42 db_lmdb: enable batch transactions by default (stoffu)
34cb6b4 add --regtest and --fixed-difficulty for regression testing (vicsn)
9e1403e update get_info RPC and bump RPC version (vicsn)
207b66e first new functional tests (vicsn)
2018-07-19 13:35:25 -05:00
victorsintnicolaas 34cb6b4b70 add --regtest and --fixed-difficulty for regression testing
on_generateblocks RPC call combines functionality from the on_getblocktemplate and on_submitblock RPC calls to allow rapid block creation. Difficulty is set permanently to 1 for regtest.
Makes use of FAKECHAIN network type, but takes hard fork heights from mainchain
Default reserve_size in generate_blocks RPC call is now 1. If it is 0, the following error occurs 'Failed to calculate offset for'.
Queries hard fork heights info of other network types
2018-06-29 10:06:11 +02:00
luigi1111 3ad4ecd4ff
Merge pull request #3982
08b85a8 cryptonote_config: add get_config to refactor x = testnet ? config::testnet::X : stagenet ? config::stagenet::X : config::X (stoffu)
0cf80ba net_node: resolve host for node addresses given via command line flags (stoffu)
2018-06-27 15:38:23 -05: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
luigi1111 36aeaa7545
Merge pull request #3757
6f9260e handle optional miner params better (cryptochangements34)
2018-06-20 14:09:42 -05:00
stoffu 0c4148845b
miner: show id and height when a block is found 2018-06-20 12:08:40 +09:00
luigi1111 9a3bd88b9f
Merge pull request #3851
a87980f fix build with GCC 8.1.0 (moneromooo-monero)
2018-06-19 12:51:13 -05:00
luigi1111 42e7f31613
Merge pull request #3725
9cc0d42 connection_context: remove state_ prefix from state names (moneromooo-monero)
d9d002c daemon: print peer state in sync_info (moneromooo-monero)
2018-06-16 14:01:12 -05:00
stoffu 08b85a8e00
cryptonote_config: add get_config to refactor x = testnet ? config::testnet::X : stagenet ? config::stagenet::X : config::X 2018-06-11 20:17:02 +09:00
stoffu 98cf62cc45
hardfork: fix get_next_version() 2018-05-30 09:49:57 +09:00
stoffu a79fc219b7
hardfork: fix get_earliest_ideal_height_for_version() to support non-existent versions 2018-05-30 09:49:52 +09:00
moneromooo-monero a87980f6c2
fix build with GCC 8.1.0 2018-05-26 14:54:10 +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 6f859e4328
cryptonote: make sure outPk setup always happens 2018-05-07 19:21:52 +01:00
cryptochangements34 6f9260e38e handle optional miner params better 2018-05-06 12:28:57 -04:00
moneromooo-monero 9cc0d4220f
connection_context: remove "state_" prefix from state names
It's redundant and makes it easier to print them in columns
2018-04-28 19:56:28 +01:00
Dimitris Apostolou 57c0b1ed9f Fix typos in various files 2018-03-15 18:25:38 +02:00
stoffu 8705beaf51
keypair::generate: always require hw::device to avoid possible mistake 2018-03-14 21:00:16 +09:00
stoffu 27a196b126
device: untangle cyclic depenency
When #3303 was merged, a cyclic dependency chain was generated:

    libdevice <- libcncrypto <- libringct <- libdevice

This was because libdevice needs access to a set of basic crypto operations
implemented in libringct such as scalarmultBase(), while libringct also needs
access to abstracted crypto operations implemented in libdevice such as
ecdhEncode(). To untangle this cyclic dependency chain, this patch splits libringct
into libringct_basic and libringct, where the basic crypto ops previously in
libringct are moved into libringct_basic. The cyclic dependency is now resolved
thanks to this separation:

    libcncrypto <- libringct_basic <- libdevice <- libcryptonote_basic <- libringct

This eliminates the need for crypto_device.cpp and rctOps_device.cpp.

Also, many abstracted interfaces of hw::device such as encrypt_payment_id() and
get_subaddress_secret_key() were previously implemented in libcryptonote_basic
(cryptonote_format_utils.cpp) and were then called from hw::core::device_default,
which is odd because libdevice is supposed to be independent of libcryptonote_basic.
Therefore, those functions were moved to device_default.cpp.
2018-03-14 21:00:15 +09:00
stoffu c9b38b4765
device: made function prototypes consistent with pre-#3303 codebase 2018-03-14 21:00:06 +09:00
Cédric 73dd883d51 Ledger HW Bug fixes
Fix the way the REAL mode is handle:
  Let create_transactions_2 and create_transactions_from construct the vector of transactions.
  Then iterate on it and resign.
  We just need to add 'outs' list in the TX struct for that.

Fix default secret keys value when DEBUG_HWDEVICE mode is off
  The magic value (00...00 for view key and FF..FF for spend key) was not correctly set
  when DEBUG_HWDEVICE was off. Both was set to 00...00.

Add sub-address info in ABP map in order to correctly display destination sub-address on device

Fix DEBUG_HWDEVICE mode:
   - Fix compilation errors.
   - Fix control device init in ledger device.
   - Add more log.

Fix sub addr control

Fix debug Info
2018-03-12 10:43:06 +01:00
moneromooo-monero 608fd6f14a
Monero Cryptonight variants, and add one for v7
This is the first variant of many, with the intent to improve
Monero's resistance to ASICs and encourage mining decentralization.
2018-03-05 18:18:39 +00:00
Riccardo Spagni 4f93f74528
Merge pull request #3277
0e7ad2e2 Wallet API: generalize 'bool testnet' to 'NetworkType nettype' (stoffu)
af773211 Stagenet (stoffu)
cc9a0bee command_line: allow args to depend on more than one args (stoffu)
55f8d917 command_line::get_arg: remove 'required' for dependent args as they're always optional (stoffu)
450306a0 command line: allow has_arg to handle arg_descriptor<bool,false,true> #3318 (stoffu)
9f9e095a Use `genesis_tx` parameter in `generate_genesis_block`. #3261 (Jean Pierre Dudey)
2018-03-05 19:11:20 +02:00
Edward Betts fbcc91c2a4 Correct spelling mistakes. 2018-03-05 17:00:40 +00:00
stoffu af773211cb
Stagenet 2018-03-05 11:55:05 +09:00
cslashm e745c1e38d Code modifications to integrate Ledger HW device into monero-wallet-cli.
The basic approach it to delegate all sensitive data (master key, secret
ephemeral key, key derivation, ....) and related operations to the device.
As device has low memory, it does not keep itself the values
(except for view/spend keys) but once computed there are encrypted (with AES
are equivalent) and return back to monero-wallet-cli. When they need to be
manipulated by the device, they are decrypted on receive.

Moreover, using the client for storing the value in encrypted form limits
the modification in the client code. Those values are transfered from one
C-structure to another one as previously.

The code modification has been done with the wishes to be open to any
other hardware wallet. To achieve that a C++ class hw::Device has been
introduced. Two initial implementations are provided: the "default", which
remaps all calls to initial Monero code, and  the "Ledger", which delegates
all calls to Ledger device.
2018-03-04 12:54:53 +01:00
Riccardo Spagni c9aa9370f9
Merge pull request #3260
b2d4bb9b Remove `voting_version` parameter documentation. (Jean Pierre Dudey)
2018-02-20 17:47:31 +02:00
Riccardo Spagni ff36fd93fd
Merge pull request #3255
3962bcb2 Closes #2886: really ignore battery checking (Timothy D. Prime)
2018-02-20 17:47:03 +02:00
Riccardo Spagni cfa3af4078
Merge pull request #3247
89ad162a wallet2: remove unused m_subaddresses_inv (moneromooo-monero)
f2c4c399 wallet2: speed up subaddress generation (by about a third) (moneromooo-monero)
2018-02-20 17:46:40 +02:00
moneromooo-monero f2c4c39971
wallet2: speed up subaddress generation (by about a third) 2018-02-16 17:13:06 +00:00
Riccardo Spagni f4a6bc79d9
Merge pull request #3226
e4646379 keccak: fix mdlen bounds sanity checking (moneromooo-monero)
2e3e90ac pass large parameters by const ref, not value (moneromooo-monero)
61defd89 blockchain: sanity check number of precomputed hash of hash blocks (moneromooo-monero)
9af6b2d1 ringct: fix infinite loop in unused h2b function (moneromooo-monero)
8cea8d0c simplewallet: double check a new multisig wallet is multisig (moneromooo-monero)
9b98a6ac threadpool: catch exceptions in dtor, to avoid terminate (moneromooo-monero)
24803ed9 blockchain_export: fix buffer overflow in exporter (moneromooo-monero)
f3f7da62 perf_timer: rewrite to make it clear there is no division by zero (moneromooo-monero)
c6ea3df0 performance_tests: remove add_arg call stray extra param (moneromooo-monero)
fa6b4566 fuzz_tests: fix an uninitialized var in setup (moneromooo-monero)
03887f11 keccak: fix sanity check bounds test (moneromooo-monero)
ad11db91 blockchain_db: initialize m_open in base class ctor (moneromooo-monero)
bece67f9 miner: restore std::cout precision after modification (moneromooo-monero)
1aabd14c db_lmdb: check hard fork info drop succeeded (moneromooo-monero)
2018-02-16 14:26:58 +01:00
Riccardo Spagni 853dd2d4f7
Merge pull request #3232
b81e276c connection_context: initialize m_last_request_time to current time (moneromooo-monero)
2018-02-16 14:24:12 +01:00
Jean Pierre Dudey b2d4bb9b64 Remove `voting_version` parameter documentation.
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2018-02-13 15:04:12 -04:00
Timothy D. Prime 3962bcb2a2 Closes #2886: really ignore battery checking
Move option test first.
2018-02-12 10:29:22 -08:00
moneromooo-monero b81e276cab
connection_context: initialize m_last_request_time to current time
This prevents spurious early peer drops
2018-02-04 13:13:08 +00:00
moneromooo-monero bece67f9e8
miner: restore std::cout precision after modification
Coverity 136462
2018-02-02 15:15:21 +00:00
moneromooo-monero b809058993
ringct: pseudoOuts moved to prunable in the simple bulletproof case
Saves 64 bytes non prunable data per typical tx

This breaks v7 consensus, will require a testnet reorg from v6
2018-01-31 15:56:26 +00:00
xmr-eric 84a7f6a482 Readd copyright starting date 2018-01-26 10:03:20 -05:00
xmr-eric 18216f19dd Update 2018 copyright 2018-01-26 10:03:20 -05:00
Riccardo Spagni f9c66ba67c
Merge pull request #2990
2d17feb0 factor STL container serialization (moneromooo-monero)
2018-01-10 11:53:05 +01:00
moneromooo-monero 2d17feb060
factor STL container serialization 2017-12-22 19:47:12 +00:00
moneromooo-monero b49ddc766d
check accessing an element past the end of a container 2017-12-18 15:15:49 +00:00
moneromooo-monero 2305bf260d
check return value for generate_key_derivation and derive_public_key 2017-12-18 15:15:46 +00:00
moneromooo-monero fa5697127f
make multisig work with subaddresses
Thanks to kenshi84 for help getting this work
2017-12-17 16:12:27 +00:00
moneromooo-monero f4eda44ce3
N-1/N multisig 2017-12-17 16:12:12 +00:00
moneromooo-monero 4c313324b1
Add N/N multisig tx generation and signing
Scheme by luigi1111:

    Multisig for RingCT on Monero

    2 of 2

    User A (coordinator):
    Spendkey b,B
    Viewkey a,A (shared)

    User B:
    Spendkey c,C
    Viewkey a,A (shared)

    Public Address: C+B, A

    Both have their own watch only wallet via C+B, a

    A will coordinate spending process (though B could easily as well, coordinator is more needed for more participants)

    A and B watch for incoming outputs

    B creates "half" key images for discovered output D:
    I2_D = (Hs(aR)+c) * Hp(D)

    B also creates 1.5 random keypairs (one scalar and 2 pubkeys; one on base G and one on base Hp(D)) for each output, storing the scalar(k) (linked to D),
    and sending the pubkeys with I2_D.

    A also creates "half" key images:
    I1_D = (Hs(aR)+b) * Hp(D)

    Then I_D = I1_D + I2_D

    Having I_D allows A to check spent status of course, but more importantly allows A to actually build a transaction prefix (and thus transaction).

    A builds the transaction until most of the way through MLSAG_Gen, adding the 2 pubkeys (per input) provided with I2_D
    to his own generated ones where they are needed (secret row L, R).

    At this point, A has a mostly completed transaction (but with an invalid/incomplete signature). A sends over the tx and includes r,
    which allows B (with the recipient's address) to verify the destination and amount (by reconstructing the stealth address and decoding ecdhInfo).

    B then finishes the signature by computing ss[secret_index][0] = ss[secret_index][0] + k - cc[secret_index]*c (secret indices need to be passed as well).

    B can then broadcast the tx, or send it back to A for broadcasting. Once B has completed the signing (and verified the tx to be valid), he can add the full I_D
    to his cache, allowing him to verify spent status as well.

    NOTE:
    A and B *must* present key A and B to each other with a valid signature proving they know a and b respectively.
    Otherwise, trickery like the following becomes possible:
    A creates viewkey a,A, spendkey b,B, and sends a,A,B to B.
    B creates a fake key C = zG - B. B sends C back to A.
    The combined spendkey C+B then equals zG, allowing B to spend funds at any time!
    The signature fixes this, because B does not know a c corresponding to C (and thus can't produce a signature).

    2 of 3

    User A (coordinator)
    Shared viewkey a,A
    "spendkey" j,J

    User B
    "spendkey" k,K

    User C
    "spendkey" m,M

    A collects K and M from B and C
    B collects J and M from A and C
    C collects J and K from A and B

    A computes N = nG, n = Hs(jK)
    A computes O = oG, o = Hs(jM)

    B anc C compute P = pG, p = Hs(kM) || Hs(mK)
    B and C can also compute N and O respectively if they wish to be able to coordinate

    Address: N+O+P, A

    The rest follows as above. The coordinator possesses 2 of 3 needed keys; he can get the other
    needed part of the signature/key images from either of the other two.

    Alternatively, if secure communication exists between parties:
    A gives j to B
    B gives k to C
    C gives m to A

    Address: J+K+M, A

    3 of 3

    Identical to 2 of 2, except the coordinator must collect the key images from both of the others.
    The transaction must also be passed an additional hop: A -> B -> C (or A -> C -> B), who can then broadcast it
    or send it back to A.

    N-1 of N

    Generally the same as 2 of 3, except participants need to be arranged in a ring to pass their keys around
    (using either the secure or insecure method).
    For example (ignoring viewkey so letters line up):
    [4 of 5]
    User: spendkey
    A: a
    B: b
    C: c
    D: d
    E: e

    a -> B, b -> C, c -> D, d -> E, e -> A

    Order of signing does not matter, it just must reach n-1 users. A "remaining keys" list must be passed around with
    the transaction so the signers know if they should use 1 or both keys.
    Collecting key image parts becomes a little messy, but basically every wallet sends over both of their parts with a tag for each.
    Thia way the coordinating wallet can keep track of which images have been added and which wallet they come from. Reasoning:
    1. The key images must be added only once (coordinator will get key images for key a from both A and B, he must add only one to get the proper key actual key image)
    2. The coordinator must keep track of which helper pubkeys came from which wallet (discussed in 2 of 2 section). The coordinator
    must choose only one set to use, then include his choice in the "remaining keys" list so the other wallets know which of their keys to use.

    You can generalize it further to N-2 of N or even M of N, but I'm not sure there's legitimate demand to justify the complexity. It might
    also be straightforward enough to support with minimal changes from N-1 format.
    You basically just give each user additional keys for each additional "-1" you desire. N-2 would be 3 keys per user, N-3 4 keys, etc.

The process is somewhat cumbersome:

To create a N/N multisig wallet:

 - each participant creates a normal wallet
 - each participant runs "prepare_multisig", and sends the resulting string to every other participant
 - each participant runs "make_multisig N A B C D...", with N being the threshold and A B C D... being the strings received from other participants (the threshold must currently equal N)

As txes are received, participants' wallets will need to synchronize so that those new outputs may be spent:

 - each participant runs "export_multisig FILENAME", and sends the FILENAME file to every other participant
 - each participant runs "import_multisig A B C D...", with A B C D... being the filenames received from other participants

Then, a transaction may be initiated:

 - one of the participants runs "transfer ADDRESS AMOUNT"
 - this partly signed transaction will be written to the "multisig_monero_tx" file
 - the initiator sends this file to another participant
 - that other participant runs "sign_multisig multisig_monero_tx"
 - the resulting transaction is written to the "multisig_monero_tx" file again
 - if the threshold was not reached, the file must be sent to another participant, until enough have signed
 - the last participant to sign runs "submit_multisig multisig_monero_tx" to relay the transaction to the Monero network
2017-12-17 16:11:57 +00:00
moneromooo-monero 6d219a9250
wallet: add multisig key generation
Scheme by luigi1111
2017-12-17 16:11:53 +00:00
moneromooo-monero 09ce03d612
move includes around to lessen overall load 2017-12-16 22:46:38 +00:00
Riccardo Spagni 6c0953b15a
Merge pull request #2860
3dffe71b new wipeable_string class to replace std::string passphrases (moneromooo-monero)
7a2a5741 utils: initialize easylogging++ in on_startup (moneromooo-monero)
54950829 use memwipe in a few relevant places (moneromooo-monero)
000666ff add a memwipe function (moneromooo-monero)
2017-12-16 23:19:27 +02:00
moneromooo-monero c83d0b3ee2
add bulletproofs from v7 on testnet 2017-12-08 13:50:45 +00:00
moneromooo-monero d58835b2f6
integrate bulletproofs into monero 2017-12-08 13:48:15 +00:00
moneromooo-monero 3dffe71b72
new wipeable_string class to replace std::string passphrases 2017-11-27 22:25:57 +00:00
Riccardo Spagni 7dc58410e5
Merge pull request #2784
54a4c1cb cryptonote: do not overwrite const data (moneromooo-monero)
2017-11-25 19:49:22 +02:00
Riccardo Spagni 29b0bb8952
Merge pull request #2792
47c0948a Implement missing miner functions on FreeBSD (Vasil Dimov)
fdb5bd16 Remove unused variables and fix typos in comments (Vasil Dimov)
2017-11-25 19:47:49 +02:00
moneromooo-monero 54a4c1cbf7
cryptonote: do not overwrite const data 2017-11-22 11:17:22 +00:00
moneromooo-monero 383ff4f689
remove "using namespace std" from headers
It's nasty, and actually breaks on Solaris, where if.h fails to
build due to:

  struct map *if_memmap;
2017-11-14 16:56:10 +00:00
Vasil Dimov 47c0948ab0
Implement missing miner functions on FreeBSD
cryptonote::miner::get_system_times(): Fetch the system's total and
idle time using sysctl kern.cp_time.

cryptonote::miner::get_process_time(): Use the same implementation as
Linux and OSX, the times(3) function conforms to POSIX.1 and is
available on FreeBSD.

cryptonote::miner::on_battery_power(): Try to fetch the battery status
using sysctl hw.acpi.acline. If that fails (if ACPI is not enabled on
the system), then try querying /dev/apm.
2017-11-11 16:27:19 +02:00
Vasil Dimov fdb5bd161d
Remove unused variables and fix typos in comments 2017-11-11 16:17:19 +02:00
Riccardo Spagni e50bf5f811
Merge pull request #2597
c4136134 miner: always update block template when starting (moneromooo-monero)
2017-10-15 18:47:43 +02:00
Jaquee fd773d88cd refactor cryptonote_basic::add_tx_pub_key_to_extra 2017-10-15 17:32:09 +02:00
moneromooo-monero c413613416
miner: always update block template when starting
This fixes using the previous address when starting mining,
then stopping and restarting with a different address
2017-10-07 11:32:36 +01:00
kenshi84 53ad5a0f42
Subaddresses 2017-10-07 13:06:21 +09:00
moneromooo-monero 15e6258136
connection_context: initialize m_callback_request_count to 0 2017-09-27 11:43:12 +01:00
moneromooo-monero fa54b20584
fix typo in basic and core CMakeLists.txt 2017-09-25 21:16:29 +01:00
moneromooo-monero 5d65a75b69
move checkpoints in a separate library 2017-09-25 21:16:26 +01:00
Riccardo Spagni c6306e75e7
Merge pull request #2257
651baaec wallet: add encrypted seed functionality (moneromooo-monero)
2017-09-25 16:37:17 +02:00
Riccardo Spagni 8711c355fc
Merge pull request #2410
20256b7c Fix AC power supply detection on Linux (Guillaume LE VAILLANT)
2017-09-20 21:36:09 +02:00
moneromooo-monero 651baaec46
wallet: add encrypted seed functionality
This uses luigi1111's CN_Add method.
See https://xmr.llcoins.net for details.
2017-09-12 13:56:01 +01:00
Guillaume LE VAILLANT 20256b7c04 Fix AC power supply detection on Linux
The /sys/class/power_supply/*/present file usually does not exist for
AC power supplies.
2017-09-08 11:07:56 +02:00
Riccardo Spagni d4f56bdf09
update hardcoded checkpoints 2017-09-06 09:18:46 +02:00
Riccardo Spagni 4466b6d1b0
Merge pull request #2303
5a283078 cryptonote_protocol: large block sync size before v4 (moneromooo-monero)
7b747607 cryptonote_protocol: kick idle synchronizing peers (moneromooo-monero)
2017-08-17 21:39:44 +02:00
moneromooo-monero 7b74760756
cryptonote_protocol: kick idle synchronizing peers
In case they dropped off downloading for any reason, they'll get
sent to download again.
2017-08-16 22:24:50 +01:00
Nano Akron b59cd0745b befor -> before
Really unique yet consistent spelling mistake
2017-08-15 23:23:26 +01:00
Riccardo Spagni 7b14a96c03
Merge pull request #2283
d1f204d6 miner: set thread name before logging (moneromooo-monero)
2017-08-15 20:54:53 +02:00
Riccardo Spagni 973cc7ffdf
Merge pull request #2264
980e476c cryptonote_basic: fix silly CLANG warning about not emitting function (moneromooo-monero)
2017-08-15 20:50:27 +02:00
Riccardo Spagni e5a1628c88
Merge pull request #2245
c8640a3d difficulty: fix misleading comment (Guillaume LE VAILLANT)
2017-08-15 20:46:48 +02:00
Riccardo Spagni da2c662cf2
Merge pull request #2232
87b5ede9 miner: fix ignoring battery from command line (moneromooo-monero)
2017-08-15 20:45:02 +02:00
moneromooo-monero 08abb670e1
protocol: fix reorgs while syncing 2017-08-12 11:22:42 +01:00
moneromooo-monero d1f204d640
miner: set thread name before logging 2017-08-12 09:07:40 +01:00
moneromooo-monero 3ff5ce63c5
connection_context: initialize state
Why this was initialized properly before I have no idea, but
it is not anymore. Fix it, which fixes syncing in release mode.
2017-08-09 19:01:27 +01:00
moneromooo-monero 980e476c89
cryptonote_basic: fix silly CLANG warning about not emitting function 2017-08-08 00:33:52 +01:00
Riccardo Spagni 6db8a60a18
Merge pull request #2149
158c3ecf core: thread most of handle_incoming_tx (moneromooo-monero)
f57ee382 cryptonote_protocol: retry stale spans early (moneromooo-monero)
90df52e1 cryptonote_protocol: light cleanup (moneromooo-monero)
84e23156 cryptonote_protocol: avoid spurious SYNCHRONIZED OK messages (moneromooo-monero)
5be43fcd cryptonote_protocol_handler: sync speedup (moneromooo-monero)
2017-08-07 15:24:58 +02:00
Riccardo Spagni ea46a5527a
Merge pull request #2234
214fd81e some include cleanup (moneromooo-monero)
2017-08-07 15:13:07 +02:00
Riccardo Spagni f5be5b7e7b
Merge pull request #2210
cb0b5594 Move OpenAlias console input back from libs (moneromooo-monero)
2017-08-07 15:09:45 +02:00
Riccardo Spagni ce52d94cb7
Merge pull request #2147
94717021 fix on_battery_power for linux (Ryan Mehta)
2017-08-07 14:47:43 +02:00
moneromooo-monero 5be43fcdba
cryptonote_protocol_handler: sync speedup
A block queue is now placed between block download and
block processing. Blocks are now requested only from one
peer (unless starved).

Includes a new sync_info coommand.
2017-08-07 09:33:04 +01:00
Guillaume LE VAILLANT c8640a3d74 difficulty: fix misleading comment 2017-08-02 23:59:48 +02:00
moneromooo-monero 214fd81e93
some include cleanup 2017-07-31 16:36:52 +01:00
moneromooo-monero 87b5ede908
miner: fix ignoring battery from command line 2017-07-31 08:36:57 +01:00
moneromooo-monero cb0b559451
Move OpenAlias console input back from libs
Library code should definitely not ask for console input unless
it's clearly an input function. Delegating the user interaction
part to the caller means it can now be used by a GUI, or have a
decision algorithm better adapted to a particular caller.
2017-07-27 11:30:13 +01:00
moneromooo-monero f5f985c018
miner: fix background mining options parsing
They were set as uint8_t, which boost was apparently treating
as a character type, rather than a numeric type
2017-07-12 11:22:50 +01:00
Ryan Mehta 94717021ef fix on_battery_power for linux
fix ac/battery linux
2017-07-06 10:03:55 -07:00
jethro 1b75ad91aa Add OSX background mining
Implements miner::get_system_times, miner::get_process_time and
miner::on_battery_power for OSX so that background mining works on OSX.
2017-06-08 09:26:09 -04:00
Gentian 4b932ff314 changed crypto to cncrypto so it generated libcncrypto
fix a cmakelist
2017-05-23 07:45:40 -04:00
Riccardo Spagni acbe0b4849
Merge pull request #1938
bff90264 Add expected total reward to RPC "getblocktemplate". Only works from V5 fork onward - returns 0 before that block. (assylias)
2017-04-24 10:41:32 +02:00
assylias bff90264b8
Add expected total reward to RPC "getblocktemplate".
Only works from V5 fork onward - returns 0 before that block.
2017-04-19 18:28:16 +01:00
Lee Clagett 93e10f1cc4 Simplified the implementation and features of span 2017-04-11 16:35:14 -04:00
Lee Clagett 4a8f96f95d Improvements for epee binary to hex functions:
- Performance improvements
  - Added `span` for zero-copy pointer+length arguments
  - Added `std::ostream` overload for direct writing to output buffers
  - Removal of unused `string_tools::buff_to_hex`
2017-04-11 16:35:00 -04:00
Riccardo Spagni c8dd4c58ce
Merge pull request #1955
5b632468 core: fix blob size cache, and reenable hash and blob size caches (moneromooo-monero)
2017-04-11 00:34:03 +02:00
Riccardo Spagni 6353e5b0e5
Merge pull request #1946
a38343bf miner: add a debug log in pause and resume (moneromooo-monero)
2017-04-11 00:23:43 +02:00
moneromooo-monero 5b63246813
core: fix blob size cache, and reenable hash and blob size caches 2017-04-03 22:19:57 +01:00
moneromooo-monero a38343bf68
miner: add a debug log in pause and resume 2017-03-31 20:01:58 +01:00
Guillaume LE VAILLANT 64377c90b5 Add other possible paths of AC power status file on Linux 2017-03-28 11:35:18 +02:00
moneromooo-monero a96f9baeb4
core: disable tx/block hash cache
Looks like it doesn't work on win64
2017-03-26 02:21:01 +01:00
moneromooo-monero 6d315459b6
core: avoid possible reordering bugs wth tx/bloch hash cache 2017-03-25 09:18:53 +00:00
moneromooo-monero f065234b71
core: cache tx and block hashes in the respective classes
An idea from smooth
2017-03-23 09:25:17 +00:00
stoffu 250c4cb3e0
wallet-rpc: enable openalias 2017-03-17 10:42:10 +09:00
moneromooo-monero 3396a9f2af
Add intervening v5 fork for increased min block size
Minimum mixin 4 and enforced ringct is moved from v5 to v6.
v5 is now used for an increased minimum block size (from 60000
to 300000) to cater for larger typical/minimum transaction size.

The fee algorithm is also changed to decrease the base per kB
fee, and add a cheap tier for those transactions which we do
not care if they get delayed (or even included in a block).
2017-03-15 08:32:51 +00:00
kenshi84 7d07c64fe5
fix dependency: put HardFork back to cryptonote_basic, made some BlockchainDB functions virtual again to avoid missing symbols error 2017-03-10 11:22:39 +09:00
lethos3 d18ff58a1c format_utils: fix typo in assert message
Fix two small typos as mentioned by reddit user nthterm.
2017-03-05 11:11:44 +13:00
Riccardo Spagni d35d626181
Merge pull request #1826
2c468dd4 allow user I/O in millinero, micronero, nanonero, piconero (moneromooo-monero)
2017-03-03 14:31:04 +02:00
Riccardo Spagni 78a99fe7da
Merge pull request #1820
7a44f38a Add support for the wallet to refresh pruned blocks (moneromooo-monero)
da18898f ringct: do not require range proof in decodeRct/decodeRctSimple (moneromooo-monero)
b49c6ab4 rpc: add a default category for daemon rpc (moneromooo-monero)
f113b92b core: add functions to serialize base tx info (moneromooo-monero)
6fd4b827 node_rpc_proxy: allow caching daemon RPC version (moneromooo-monero)
b5c74e40 wallet: invalidate node proxy cache when reconnecting (moneromooo-monero)
2017-03-03 14:30:02 +02:00
moneromooo-monero 2c468dd429
allow user I/O in millinero, micronero, nanonero, piconero 2017-03-02 19:02:41 +00:00
moneromooo-monero f113b92b93
core: add functions to serialize base tx info
That is, information without signatures (for v1) nor range
proofs and MGs (for v2)
2017-02-27 20:24:39 +00:00
moneromooo-monero 12adb4a3f3
core: move hardfork back to cryptonote_core
should fix a cross dependency betewen cryptonote_basic and
blockchain_db
2017-02-25 16:41:35 +00:00
Riccardo Spagni c3599fa7b9
update copyright year, fix occasional lack of newline at line end 2017-02-21 19:38:18 +02:00
Riccardo Spagni 565c99f670
Merge pull request #1731
a427235e core: add a missing newline on a string to be logged (moneromooo-monero)
b6a2230e unit_tests: fix minor blockchain_db regression (moneromooo-monero)
c488eca5 hardfork: tone down some logs (moneromooo-monero)
2017-02-21 11:21:57 +02:00
Riccardo Spagni 6994c85201
Merge pull request #1733
a493c0b1 BACKGROUND_MINING_MINER_MONITOR_INVERVAL_IN_SECONDS was odr-used, so required a definition. (Dion Ahmetaj)
2017-02-21 11:21:14 +02:00
Riccardo Spagni d11dbe7dc2
Merge pull request #1744
a5a0a3c8 core: updates can now be downloaded (and SHA256 hash checked) (moneromooo-monero)
216f062e util: add a SHA256 function (moneromooo-monero)
4bf78492 mlog: only silence errors for net by default, not net.* (moneromooo-monero)
d282cfcc core: test key images against validity domain (moneromooo-monero)
efb72e74 http_client: add a couple consts (moneromooo-monero)
f640512c Optionally query moneropulse DNS records to check for updates (moneromooo-monero)
e3cae4ae core: display any fork warning at startup too (moneromooo-monero)
969ad710 dns_utils: fix first checked DNS entry being ignored (moneromooo-monero)
08c3f380 util: add a vercmp function to compare version numbers (moneromooo-monero)
e8a7525c dns_utils: factor TXT record loading code from checkpoint code (moneromooo-monero)
2017-02-21 11:16:43 +02:00
moneromooo-monero e8a7525ceb
dns_utils: factor TXT record loading code from checkpoint code 2017-02-20 22:57:57 +00:00
Dion Ahmetaj 69ab14d91e More robust battery status handling.
Added an extra path to check for linux power supply status.
Added ignore battery option. If set to true, then when we can't figure out
the power status, we'll assume the system is plugged in.
2017-02-16 14:35:01 -05:00
Dion Ahmetaj a493c0b196 BACKGROUND_MINING_MINER_MONITOR_INVERVAL_IN_SECONDS was odr-used, so required a definition.
Instead of adding a declaration to cpp file, I changed it to non odr-used.
2017-02-15 11:15:12 -05:00
moneromooo-monero c488eca5e8
hardfork: tone down some logs 2017-02-14 18:56:39 +00:00
Dion Ahmetaj ad95e65028 Added a note about smart mining to status command. Fixed up a bug where I was resetting bg mining enabled instead of started. Upped the miner threshold. Also moved setting of enabled on start above miner thread creation since starting with true, then stopping, then starting with false resulted in race condition. 2017-02-10 18:07:43 -05:00
Dion Ahmetaj e4dfd2fb63 Changed ac_line_status to on_battery_power. 2017-02-10 18:07:42 -05:00
Dion Ahmetaj 23c73269ca Use defined directive to silence pre-proc warnings. 2017-02-10 18:07:41 -05:00
Dion Ahmetaj d2c7d0f6b0 Cleaned up some logging. Thanks to moneromooo for help. 2017-02-10 18:07:41 -05:00
Dion Ahmetaj 68652cd94d Added some //TODO comments pertaining to returning enums instead of bools in order to be better able to handle failure states. 2017-02-10 18:07:41 -05:00
Dion Ahmetaj 0b1045ed7d Moved around checking of AC power in order to bail quicker to sleep if not plugged in. 2017-02-10 18:07:40 -05:00
Dion Ahmetaj 2937fdbbbf Moved setting of previous process times to block where background mining is started, and added an explicit sleep in that block to wait for some mining to occur. 2017-02-10 18:07:40 -05:00
Dion Ahmetaj 21a1e0252f Set background mining started bool to false on bg thread start. If mining::stop then mining::start, idle logic is re-run instead of starting immediately (if it was running before stop). 2017-02-10 18:07:39 -05:00
Dion Ahmetaj 345ed4823c Background/smart mining. If a users' computer is plugged into a power
source, and CPU has been idle for some time, then begin mining to some
threshold (don't destroy the users' CPU).

This patch only supports windows and linux (I've only tested on Win64 and
Ubuntu).

The variables currently default to pretty conservative values (i.e. 20%
CPU mining threshold).
2017-02-10 18:07:39 -05:00
kenshi84 8027ce0c75 extract some basic code from libcryptonote_core into libcryptonote_basic 2017-02-08 22:45:15 +09:00