Commit Graph
100 Commits
Author SHA1 Message Date
moneromooo-moneroandJethro Grassie 76043b17fd monero-wallet-cli: hang on exit in readline code (#2117)
readline_buffer: move a local to local scope

Also limit the select fd limit to what we use

Signed-off-by: Jethro Grassie <jtg@xtrabass.com>
2017-06-28 07:54:29 -04:00
moneromooo-moneroandJethro Grassie a73a42a6b0 monero-wallet-cli: hang on exit in readline code (#2117)
readline_buffer: fix start/stop threads being starved by process

process could run for quite some time re-acquiring the process
lock, leaving start/stop starving. Yielding after unlock in
process is much better but doesn't seem to be enough to reliably
yield, so we sleep for a millisecond, which should be transparent
for user input anyway.

Signed-off-by: Jethro Grassie <jtg@xtrabass.com>
2017-06-28 07:54:20 -04:00
moneromooo-monero 8f96cfc20a Remove typeid use in network_address
Since I had to add an ID to the derived classes anyway,
this can be used instead. This removes an apparently
pointless warning from CLANG too.
2017-06-28 09:11:24 +01:00
moneromooo-monero 3b599d2b7e wallet2: get current height from the daemon on creation
Use current time to estimate current height only if the daemon
cannot be queried.
2017-06-26 08:11:14 +01:00
moneromooo-monero d3bb72fff1 wallet2: fix infinite loop on future refresh height
If the refresh height is in the future, the current code will
loop till the actual height reaches this. Fix it by bailing out
if we receive only three hashes, which is what we set in the
call parameters.
2017-06-26 06:58:37 +01:00
moneromooo-monero 32754784db wallet: fix refresh_from_height setting on new wallet
The previous patch was based on a wrong premise (that the
daemon height was 0 because the daemon calling code wasn't
yet initialized). In fact, current height approximation
was not setup for testnet. Fix this.
2017-06-26 06:58:31 +01:00
moneromooo-monero 841231e5bd Add fuzz testing using american fuzzy lop
Existing tests: block, transaction, signature, cold outputs,
cold transaction.

Data for these is in tests/data/fuzz.

A convenience shell script is in contrib/fuzz_testing/fuzz.sh, eg:

contrib/fuzz_testing/fuzz.sh signature

The fuzzer will run indefinitely, ^C to stop.

Fuzzing is currently supported for GCC only. I can't get CLANG
to build Monero here as it dies on some system headers, so if
someone wants to make it work on both, that'd be great.
In particular, the __AFL_LOOP construct should be made to work
so that a given run can fuzz multiple inputs, as the C++ load
time is substantial.
2017-06-24 16:46:18 +01:00
moneromooo-monero 8261ba69e6 readline_buffer: fix busy wait
It'd eat up a core constantly, due to spending its time jumping
back and forth between userland and kernel. We now wait for up
to a millisecond in kernel, which will be transparent to the user
and drop to idle most of the time.
2017-06-23 13:21:50 +01:00
moneromooo-monero bb708ab8c3 electrum-words: fix seed mistakenly thought to be old style
It'd see "empty" words due to extraneous spaces
2017-06-22 16:47:07 +01:00
moneromooo-monero 21b939e1e6 readline: fix invalid memory access
m_cout_buf was not initialized
2017-06-21 17:33:47 +01:00
moneromooo-monero 5f8f290505 readline_buffer: add a couple const 2017-06-21 17:33:30 +01:00
moneromooo-monero f4e3dca113 unit_tests: fix build failures after network_address changes 2017-06-19 11:26:02 +01:00
moneromooo-monero 4e13ab306a wallet_api: fix missing transaction parameter in callback
It was unused, so harmless

Reported by erikd on IRC
2017-06-13 19:34:51 +01:00
moneromooo-monero 235df7f484 blockchain_db: add a txpool tx getter which returns existence
Avoids exception spam for the "nope, not found" case
2017-06-11 15:36:48 +01:00
moneromooo-monero b2319a03a6 simplewallet: new command to generate a random payment id
This is trivial, but often requested, and possibly hard to do
in Windows. That makes it more user friendly.
2017-06-10 10:08:55 +01:00
moneromooo-monero c3bec61da2 core_tests: fix tests failing due to new txpool code requitring batch transactions 2017-06-09 20:49:59 +01:00
moneromooo-monero 6fc2dc3927 cryptonote_protocol_handler: fix crash in debug log 2017-06-01 19:42:33 +01:00
moneromooo-monero 31417d57da tx_pool: add missing blockchain lock in add_tx 2017-05-31 22:55:13 +01:00
moneromooo-monero 977c2186c9 easylogging++: log timestamps in GMT for privacy 2017-05-28 13:20:27 +01:00
moneromooo-monero 05f3dcf738 simplewallet: fix refresh height for new wallets
With the recent change to wallet creation code, the code was
calling to the daemon before the wallet's daemon address was
initialized, and thus failing. This was causing all new wallets
to refresh from 0 instead of just fetching early block hashes.
2017-05-28 13:17:32 +01:00
moneromooo-monero 072102cfd2 abstracted nework addresses
All code which was using ip and port now uses a new IPv4 object,
subclass of a new network_address class. This will allow easy
addition of I2P addresses later (and also IPv6, etc).
Both old style and new style peer lists are now sent in the P2P
protocol, which is inefficient but allows peers using both
codebases to talk to each other. This will be removed in the
future. No other subclasses than IPv4 exist yet.
2017-05-27 11:35:54 +01:00
moneromooo-monero 0a182576d0 node_rpc_proxy: fix earliest fork height query for unknown forks 2017-05-26 21:34:44 +01:00
moneromooo-monero b52abd1370 Move txpool to the database
Integration could go further (ie, return_tx_to_pool calls should
not be needed anymore, possibly other things).

poolstate.bin is now obsolete.
2017-05-25 22:23:37 +01:00
moneromooo-monero 89b2f3061b tests: fix invalid key image test
It was using an invalid key image which wasn't in the key image
domain, so the transaction was rejected earlier than the test
was expecting
2017-05-18 09:19:55 +01:00
moneromooo-monero a374a522df wallet2: check key image validity domain in import_key_images 2017-05-18 09:19:48 +01:00
moneromooo-monero 391c918d87 wallet2: fix sweep_unmixable assuming wrong minimum mixin at v5
The bump to minimum mixin 4 was moved from v5 to v6
2017-05-07 18:27:25 +01:00
moneromooo-monero 6df83b3efb wallet: add sweep_below function
It sweeps all outputs below the given threshold

This is available via the existing sweep_all RPC, by setting
amount_threshold the desired amount (in atomic units)
2017-04-24 19:50:37 +01:00
moneromooo-monero 5d86c9f4d5 easylogging++: default to creating categories by default
This avoids error spews from easylogging++ when we try to log
something before easylogging is initialized, which can happen
when errors happen at command line parsing time
2017-04-22 12:15:57 +01:00
moneromooo-monero a6d5bb75fe wallet2: refer to triangular distribution for recent zone in comment
It was wrongly refering to equiprobable distribution, which I think
I'd originally done, but forgot to update the comment after changing
to triangular

Reported by smooth on IRC
2017-04-22 11:22:39 +01:00
moneromooo-monero ac1aba90f8 wallet2: bias fake outs more towards recent outputs
Two recent papers quantified the real usage bias for the
real output in a ring being the true one, and shows that
the current biasing is much too weak.

While we wait for a better solution, we increase the ratio
of recent-to-total fake outputs, as well as decrease the
time window for recent outputs, so that half the fake outs
are selected within the last 1.8 day. Value plucked from
figure 10, page 11 of An Empirical Analysis of Linkability
in the Monero Blockchain, 2017, Miller et al.

This is also arbitrary, of course, but serves as a stopgap
till a better selection algorithm is chosen.
2017-04-22 10:29:03 +01:00
moneromooo-monero 7f4beaa44a wallet2: fix removal of wrong txes from unconfirmed_payments
unconfirmed_payments changed from having the txid as key to
the payment id, and this was not changed to match.
2017-04-17 19:37:13 +01:00
moneromooo-monero a255a5407f simplewallet: allow multiline seed
People are likely to enter it in three lines as it is how it
is displayed at creation time
2017-04-16 11:52:30 +01:00
moneromooo-monero 5fce581ce3 mnemonics: ignore multiple whitespace between words 2017-04-16 11:29:21 +01:00
moneromooo-monero a7d78dda77 wallet2: fix --generate-from-json in RPC mode
The daemon address was initialized too late
2017-04-14 22:12:20 +01:00
moneromooo-monero a28950da73 setThreadName moved in new version of easylogging++ 2017-04-10 21:05:56 +01:00
moneromooo-monero ea359b50cb Fixup choice of easylogging++ vs libunwind stack trace code 2017-04-10 21:05:47 +01:00
moneromooo-monero 1e6d875783 easylogging++: do not disable DEBUG level based on _DEBUG/NDEBUG 2017-04-10 21:05:43 +01:00
moneromooo-monero 7a56fd6c93 easylogging++: detect DragonFly BSD as a UNIX 2017-04-10 21:05:39 +01:00
moneromooo-monero 2c8b23e331 easylogging++: fix logging with static const header only data members 2017-04-10 21:05:35 +01:00
moneromooo-monero 72663f4b83 easylogging++: allow clipping a common filename prefix 2017-04-10 21:05:28 +01:00
moneromooo-monero 5bab044984 easylogging++: add file-only logs 2017-04-10 21:05:22 +01:00
moneromooo-monero db9dc7c2df eayslogging++: Fix bad memory access before opening any files 2017-04-10 21:05:18 +01:00
moneromooo-monero 14620ca0bd easylogging++: avoid creating directory/filename for the builtin default log file 2017-04-10 21:05:15 +01:00
moneromooo-monero 0c1ad0ff1a easylogging++: Print thread ID in a nicer way 2017-04-10 21:05:11 +01:00
moneromooo-monero e7fabbd470 easylogging++: add categories 2017-04-10 21:05:07 +01:00
moneromooo-monero a8ac4f0a70 update easylogging++ to latest upstream 2017-04-10 21:05:02 +01:00
moneromooo-monero 89d707566a wallet2: fix spurious output splitting when not merging destinations 2017-04-08 11:13:28 +01:00
moneromooo-monero 10e137be3a wallet2: mention escaping/quoting --password in help string 2017-04-06 21:24:55 +01:00
moneromooo-monero eb20f7209e daemon: print average fee per byte in print_pool_stats 2017-04-04 19:00:57 +01:00
moneromooo-monero 37be70bbd7 daemon: add fee/byte when print pool transaction info 2017-04-04 09:04:39 +01:00
moneromooo-monero 893f5a301e tx_pool: add blob size and fee/byte when logging a new tx 2017-04-04 09:04:11 +01: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 548075b1f5 daemon: new relay_tx command and RPC 2017-04-02 12:17:35 +01:00
moneromooo-monero 0ee018b407 wallet2: do not go over the target tx size if many destinations
If using a large input and many destinations, the code would
generate as many outputs as it could using that input, even if
it would bring the resulting tx above the max tx size.
2017-04-02 11:13:15 +01:00
moneromooo-monero 9ae566d0dd simplewallet: fix cold signing of split transactions
They'd be rejected as suspicious as the change goes to more
than one destination. However, split transactions will most
likely include fake zero amount change to random addresses,
so we only consider change with non zero amount for this.
2017-04-02 11:11:18 +01:00
moneromooo-monero aae14a107a simplewallet: allow setting confirm-missing-payment-id in watch wallets
These can create transactions, even though they cannot sign them.
2017-04-02 11:10:11 +01:00
moneromooo-monero 62efe5f656 mlog: direct log category changes to file only
Because some people just won't even try to read what is written
and freak out because the word FATAL is in here, despite the
context making it clear it's not an error.
2017-04-01 11:29:43 +01:00
moneromooo-monero a38343bf68 miner: add a debug log in pause and resume 2017-03-31 20:01:58 +01:00
moneromooo-monero 899497069b simplewallet: factor the per-variable code in set_variable 2017-03-26 17:52:36 +01: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 6e6794786a mnemonics: sanity checks for word lists
and a test to go with it

Remember to run the test when changing word lists, or simplewallet
will throw uncaught if that word list is used.
2017-03-25 12:14:01 +00:00
moneromooo-monero e98f1114a0 mnemonics: misc cleanup
Pass relevant information to the base class instead of overwriting
default values later, use objects instead of pointers to objects
to avoid having to new objects unnecessarily.
2017-03-25 11:51:04 +00:00
moneromooo-monero a50c4a4fad wallet: option to merge destinations
With the change from the original transfer method to the new
algorithm, payments to the same destination were merged. It
seemed like a good idea, optimizing space. However, it is a
useful tool for people who want to split large outputs into
several smaller ones (ie, service providers making frequent
payments, and who do not like a large chunk of their balance
being locked for 10 blocks after each payment).

Default to off, which is a change from the previous behavior.
2017-03-25 11:44:04 +00:00
moneromooo-monero 6d315459b6 core: avoid possible reordering bugs wth tx/bloch hash cache 2017-03-25 09:18:53 +00:00
moneromooo-monero 0ad87db01f wallet: try to save large outputs when using an unneeded second input
When a single input is enough to satisfy a transfer, the code would
previously try to add a second input, to match the "canonical" makeup
of a transaction with two inputs and two outputs. This would cause
wallets to slowly merge outputs till all the monero ends up in a
single output, which causes trouble when making two transactions
one after the other, since change is locked for 10 blocks, and an
increasing portion of the remaining balance would end up locked on
each transaction.

There are two new settings (min-output-count and min-output-value)
which can control when to stop adding such unneeded second outputs.
The idea is that small "dust" outputs will still get added, but
larger ones will not.

Enable with, eg:

set min-output-count 10
set min-output-value 30

to avoid using an unneeded second output of 30 monero or more, if
there would be less than 10 such outputs left.

This does not invalidate any other reason why such outputs would
be used (ie, when they're really needed to satisfy a transfer, or
when randomly picked in the normal course of selection). This may
be improved in the future.
2017-03-24 21:04:08 +00:00
moneromooo-monero 5a7983585e blockchain: offset v5 addition date on testnet
to silence the update warning, since v5 was done very early
on testnet
2017-03-24 10:01:15 +00:00
moneromooo-monero 91d4109023 tx_pool: ensure txes loaded from poolstate.bin have their txid cached
The txid is not saved, and we want to make sure the transactions
have their txid cached while in the pool, since get_transactions
copies the transaction object, so any txid calculation on those
copies would not benefit any later caller, since the original tx
would be left without a cached txid.
2017-03-23 09:25:33 +00:00
moneromooo-monero aaeb164cf6 tx_pool: remove transactions if they're in the blockchain
When starting up, if the pool state was not saved, the pool
might contain transactions which made it into the blockchain,
so these need removing
2017-03-23 09:25:29 +00:00
moneromooo-monero 558cfc31ca core, wallet: faster tx pool scanning
Includes a new RPC to get tx pool hashes fast.
2017-03-23 09:25:22 +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
moneromooo-monero 00cbf72064 ringct: move ge_frombytes_vartime failure error to warning
Avoids scaring people when seeing some invalid txes
2017-03-22 21:26:38 +00:00
moneromooo-monero c94f8facf5 daemon: better error reporting in commands 2017-03-21 19:21:00 +00:00
moneromooo-monero 2242d8ebd6 tx_pool: silence use of uninitialized warning
The result is not actually used when uninitialized
2017-03-21 12:21:19 +00:00
moneromooo-monero 995969b190 wallet: fix set_log not handling 0,xxx style settings 2017-03-21 11:17:05 +00:00
moneromooo-monero 350e99ae57 wallet2: cache which pool txes were scanned already
This massively speeds up the wallet updating the pool on mainnet,
where the tx backlog is more than 500 txes.
2017-03-21 10:30:25 +00:00
moneromooo-monero 7c03349869 blockchain: lower the relay fee by 2%
This ensures we accept txes with a fee that's slightly too small,
to accomodate blockchain median jitter
2017-03-20 19:14:12 +00:00
moneromooo-monero 266492e919 tx_pool: use new filling algorithm from v5 only 2017-03-20 18:46:57 +00:00
moneromooo-monero 5b7c6ced80 wallet2: start using new fee priorities at v5, not 14 days laer
Waiting would mean the fee used is 1x base, but the base will
have suddenly dropped
2017-03-20 18:34:56 +00:00
moneromooo-monero c1e9ccc794 wallet2: speed up transactions using remote nodes
Asking for a full histogram from a remote node (since it's
untrusted) is pretty slow, and spams the remote node, so
we replace it by only adding a second input if we have rct
ones, which are for all intents and purposes always mixable.
2017-03-20 08:44:28 +00:00
moneromooo-monero a6f1d8fc4c core: call {prepare|cleanup}_handle_incoming_blocks when adding a mined block
This ensures that a batch can't also be started/stopped out of
sync by another thread and us getting in the middle
2017-03-19 12:40:26 +00:00
moneromooo-monero 0effe196e4 Revert "Increase the log level for the info about log levels"
We want to know which log categories are active.

This reverts commit 4f7bce6d20.
2017-03-19 09:39:28 +00:00
moneromooo-monero 24ae71404f wallet: increase node_rpc_proxy timeout to match wallet2 2017-03-18 23:06:06 +00:00
moneromooo-monero d5fbfd677c daemon: fix missing close parenthesis in alt_chain_info output
Reported by assylias_ on IRC
2017-03-18 19:19:32 +00:00
moneromooo-monero f9a2b5279d simplewallet: allow setting tx priority in watch wallets
Those can create unsigned transactions
2017-03-18 18:07:54 +00:00
moneromooo-monero 63d7cd8882 daemon: alt_chain_info now prints fork depth 2017-03-18 16:59:57 +00:00
moneromooo-monero e9175cec07 wallet_rpc_server: make a few RPCs unavailable in restricted mode
Address book modification, setting tx nodes, importing key images
2017-03-18 13:01:53 +00:00
moneromooo-monero d023831327 use const references in catch blocks 2017-03-18 12:56:07 +00:00
moneromooo-monero 3fa5975520 wallet2: call is_key_image_spent in blocks in rescan_spent
This is a potentially long lasting daemon RPC call
2017-03-18 12:47:07 +00:00
moneromooo-monero 9d134e8647 wallet_rpc_server: add a rescan_spent RPC 2017-03-18 12:04:17 +00:00
moneromooo-monero 1a666c3016 simplewallet: catch case where no transactions are made
This would otherwise be a silent noop, which is confusing.
This can happen if the daemon is started, but not yet ready
to service all requests, and this is a safe catch all.
2017-03-18 11:44:31 +00:00
moneromooo-monero c1c9eeaaf7 p2p: use the fallback seed IPs when not enough seeds are found
In case the DNS seed(s) is/are down, which would otherwise
cause the fallback seeds to never be used. Also if the seeds
resolve to too few IPs.
2017-03-18 11:40:28 +00: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
moneromooo-monero b54e19d00e protocol: fix wrong tx being looked up from fluffy block
Found by smooth
2017-03-13 19:16:25 +00:00
moneromooo-monero 74b216a17f core: don't try to re-relay an empty set of pool transactions 2017-03-12 14:57:58 +00:00
moneromooo-monero 09e060febb protocol: fix fluffy to normal block dropping txes 2017-03-12 14:14:51 +00:00
moneromooo-monero cfa2564a40 blockchain: don't try to load an empty block hash set
If the blocks aren't being linked against a binary (such as
one of the blockchain utilities), the symbol will not be
NULL, but the size will be 0. This avoids a apurious warning
about the data hash.
2017-03-05 19:46:55 +00:00
moneromooo-monero 3835903650 blockchain_import: make --log-level understand categories 2017-03-05 19:45:22 +00:00
moneromooo-monero 5fee85616d blockchain_export: make --log-level understand categories 2017-03-05 19:45:00 +00:00
moneromooo-monero 50ebf66150 blockchain_import: error out nicely on exceptions 2017-03-05 19:25:01 +00:00
moneromooo-monero 87d57d9c59 blockchain_export: error out nicely on exceptions 2017-03-05 19:24:47 +00:00