Commit Graph
100 Commits
Author SHA1 Message Date
moneromooo-monero 46188734f6 tests: fix a bitflag test typo 2016-07-26 22:40:46 +01:00
moneromooo-monero 89e68d778d unit_tests: check adding checkpoints succeeded 2016-07-26 22:40:38 +01:00
moneromooo-monero 121165f222 db_lmdb: add some missing api call checks 2016-07-26 22:39:51 +01:00
moneromooo-monero 22d8344cb5 core_rpc_server: fix gray/white peer list mixup 2016-07-26 20:02:43 +01:00
moneromooo-monero b3801faafa hardfork: fix off by one in rescaning fork state after restart
This code should die anyway.
2016-07-25 23:16:02 +01:00
moneromooo-monero ebf97d76f0 wallet: new {ex,im}port_key_images commands and RPC calls
They are used to export a signed set of key images from a wallet
with a private spend key, so an auditor with the matching view key
may see which of those are spent, and which are not.
2016-07-24 09:23:30 +01:00
moneromooo-monero 83128877e0 simplewallet: suggest removing cache when loading fails 2016-07-22 17:31:52 +01:00
moneromooo-monero b89b96394a wallet: add unconfirmed incoming txes from the txpool
Shown in show_transfers simplewallet command, and get_transfers
RPC command, if req.pool is true.
2016-07-20 19:14:44 +01:00
moneromooo-monero 080a60610f simplewallet: revert to foreground refresh at startup
Background refresh is confusing to users at startup.
2016-07-20 19:09:32 +01:00
moneromooo-monero 89d9f382a0 wallet: add command and RPC to sign/verify data
Signing is done using the spend key, since the view key may
be shared. This could be extended later, to let the user choose
which key (even a per tx key).
simplewallet's sign/verify API uses a file. The RPC uses a
string (simplewallet can't easily do strings since commands
receive a tokenized set of arguments).
2016-07-19 20:39:03 +01:00
moneromooo-monero 87b1153f37 wallet2_api: use uint64_t for amounts 2016-07-17 09:33:31 +01:00
moneromooo-monero d7b681cd65 remove hf_starting_height db
It's not really needed, it used to be an optimization for when
that code was not using the db and needed to recalculate things
fast on startup.
2016-07-13 21:38:34 +01:00
moneromooo-monero 014f3a0d39 Add a daemon RPC version, and make simplewallet check it
If the version is different, simplewallet will refuse to use that
daemon, unless --allow-mismatched-daemon-version is used.
2016-07-10 16:49:40 +01:00
moneromooo-monero 78cc10f3fa daemon: fix ban seconds being misinterpreted as absolute
Absolute to relative conversion is already done by the callee.
2016-07-10 15:13:53 +01:00
moneromooo-monero 34ecfdbf15 rpc: fix get_bans and set_bans RPC names, they were missing a _ 2016-07-10 15:10:51 +01:00
moneromooo-monero a95a2cbc4d wallet_rpc_server: add payment id from integrated addresses to extra 2016-07-10 13:46:18 +01:00
moneromooo-monero a0bf85d09d wallet2_api: make this build (smatch needs .str() for /=) 2016-07-07 22:42:59 +01:00
moneromooo-monero c2ad9caf01 allow peers without port
The default port is then used
2016-07-03 12:51:12 +01:00
moneromooo-monero 459ec6040e daemon: print exception errors when failing to parse config file
When an exception happens while reading the config file, we need
to print the error, as the logging system isn't initialized yet,
so the generic catch will not print anything.
2016-06-30 22:15:40 +01:00
moneromooo-monero f11191a818 rpc: restrict number of fake outs requested in restricted rpc mode 2016-06-29 20:43:14 +01:00
moneromooo-monero 6b08001f9e simplewallet: mention the background refresh thread when starting
It should be less confusing for people who're used to the foreground
refresh from earlier versions.
2016-06-22 23:05:50 +01:00
moneromooo-monero 945c272f6c wallet: add a fee multiplier
Fee can now be multiplied by 2 or 3, if users want to give
priority to their transactions. There are only three levels
to avoid too much fingerprinting. Default is 1 (minimum fee).
The default multiplier can be set by "set fee-multiplier X".
2016-06-22 22:21:30 +01:00
moneromooo-monero 15c2b69db7 common: fix build without libunwind 2016-06-20 19:23:32 +01:00
moneromooo-monero f72388c1c6 CMakeLists: fix build without libunwind 2016-06-20 19:20:14 +01:00
moneromooo-monero f0b85c1631 simplewallet: add a status command
It matches the daemon, and should allow people who're suspicious
of the background refresh to know they're synced.
2016-06-20 19:11:10 +01:00
moneromooo-monero 3c3537e8c6 cmake: add missing FindLibunwind.cmake 2016-06-20 00:34:06 +01:00
moneromooo-monero 5dc09f2666 wallet_rpc_server: fix some string values being returned between <> 2016-06-19 17:52:46 +01:00
moneromooo-monero f8213c0644 Require 64/16 characters for payment ids
The default behavior for hex string parsing would allow the
last digit to be made from a single hexadecimal character,
which is correct, but we typically do not want that as it
gets confusing and easy to not spot wrong input size.
2016-06-19 17:52:39 +01:00
moneromooo-monero 0c6e9e4ddd rpc: fix getblock RPC sending blob as binary, not hex dump 2016-06-10 17:48:19 +01:00
moneromooo-monero c5f00bc751 cn_deserialize: add minergate data 2016-06-06 18:51:36 +01:00
moneromooo-monero 2470b20029 cn_deserialize: print extra nonce as hex data 2016-06-06 18:51:10 +01:00
moneromooo-monero d539be3359 crypto: make clear generate_random_bytes is not thread safe
And add a thread safe version to encourage proper use
2016-05-15 00:05:59 +01:00
moneromooo-monero 9ef8c7b694 tests: fix tests broken by the removal of the block reward accumulation loop
The tests for rejection of unmixable outputs in v2 are commented out,
as there are no unmixable outputs created anymore. This should be
restored at some point.
2016-05-01 20:59:41 +01:00
moneromooo-monero a6e717ed30 cn_deserialize: deserialize tx_extra too 2016-05-01 11:42:48 +01:00
moneromooo-monero 3eff37f931 unit_tests: add a write_varint/read_varint test 2016-05-01 11:42:31 +01:00
moneromooo-monero 7a663873ce unit_tests: fix UNBOUND_LIBRARIES/UNBOUND_LIBRARY typo 2016-05-01 11:35:14 +01:00
moneromooo-monero d6bce4be36 core: move tx_extra parsing errors to log level 1
They're not fatal, though indicate something wrong
2016-05-01 11:35:06 +01:00
moneromooo-monero e409e59d29 Print stack trace on exceptions
if libunwind is found.

Useful for debugging logs.
2016-04-28 23:34:51 +01:00
moneromooo-monero 76c6bf1875 simplewallet: display all settings on set with no arguments 2016-04-28 22:09:49 +01: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 09dddf281a wallet: add a filter_by_height field to get_transfers
It allows a simple get_transfers (with default 0 min_height and
max_height) to return all transactions, instead of the unexpected
set of txes in block 0, which is probably none at all.
2016-04-27 23:43:39 +01:00
moneromooo-monero a687e6e592 simplewallet: fix pending transfers fee display in show_transfers 2016-04-26 22:42:26 +01:00
moneromooo-monero d7bb1752eb simplewallet: more threading fixes 2016-04-26 22:40:57 +01:00
moneromooo-monero 48ab3f93ff wallet: add get_transfers rpc call
Allows getting in, out, pending, and failed transfers, similarly
to the show_transfers command.
2016-04-26 22:39:52 +01:00
moneromooo-monero 7baed9bd89 wallet: allow attaching notes to txids 2016-04-26 19:07:33 +01:00
moneromooo-monero ce6f8a6324 wallet: add GMT timestamps to transfers/payments 2016-04-26 19:07:25 +01:00
moneromooo-monero 31587bdd15 random: call abort(3) instead of assert in must_succeed macro
Avoids silent use of bad RNG in release builds, in case those
calls might actually fail.

Reported by smooth.
2016-04-24 12:26:56 +01:00
moneromooo-monero 4b1c0d69f4 simplewallet: some background refresh threading fixes
We want to lock operations which access the blockchain in
wallet2. We also want the background refresh to happen again
when we cancel a foreground refresh. Wrap the locking setup
in a macro so it doesn't get copy/pasted/mangled, and use
a scope exit trick to ensure it's always properly restored.
2016-04-21 00:11:11 +01:00
moneromooo-monero b0850a9bea wallet: add a new sweep_all command and RPC command
This sends all outputs in a wallet to a given address, alleviating
the difficulty people have had trying to send all monero but
being left with some small amount left.
2016-04-19 21:20:27 +01:00
moneromooo-monero 70c86561af blockchain: add missing overflow check for already generated coins
When reaching the tail emission phase, the amount of coins will
eventually go over MONEY_SUPPLY, overflowing 64 bits. There was
a check added to blockchain_storage, but this was not ported to
the blockchain DB version.

Reported by smooth.
2016-04-17 14:46:17 +01:00
moneromooo-monero d6fd6be5de blockchain: update cumulative block limit when popping a block
Avoids possible issues with accepting a tx too large to fit
in an actual block.

Reported by smooth.
2016-04-17 14:46:13 +01:00
moneromooo-monero 3102feb56c abstract_tcp_server2: fix send queue limit warning spam
When the send queue limit is reached, it is likely to not drain
any time soon. If we call close on the connection, it will stay
alive, waiting for the queue to drain before actually closing,
and will hit that check again and again. Since the queue size
limit is the reason we're closing in the first place, we call
shutdown directly.
2016-04-17 11:47:22 +01:00
moneromooo-monero 6bca9a8ef4 abstract_tcp_server2: avoid deadlock waiting for send queue to drain
If we reach the send queue size limit, we need to release the lock,
or we will deadlock and it will never drain.

If we reach that limit, it's likely there's another problem in the
first place though, so it will probably not drain in practice either,
unless some kind of transient network timeout.
2016-04-17 11:45:38 +01:00
moneromooo-monero 7450656bf3 net_node: fix connection leak when ping fails with bad response
If there is no comms error, but the response is not as expected,
close would not be called.
2016-04-17 11:24:07 +01:00
moneromooo-monero 672162d9e2 tests: fix compile failure on wallet2::transfer 2016-04-17 11:21:01 +01:00
moneromooo-monero b0c18ef9cd wallet2: move output selection api public 2016-04-17 11:20:44 +01:00
moneromooo-monero c33ffc8e94 simplewallet: save fixes in RPC mode
^C when in RPC mode would not save the wallet while it was still
refreshing after starting up.

Also, save the wallet out of the signal handler. We don't want
to call complex stuff in a signal handler.
2016-04-10 16:56:12 +01:00
moneromooo-monero f17b2f42b2 rpc: add pool/blockchain and block height results to gettransactions 2016-04-09 12:40:32 +01:00
moneromooo-monero ed61a2ccc1 simplewallet: set strict umask at start 2016-04-06 20:00:25 +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
moneromooo-monero 4cfb4dff3e blockchain: remove the tx validation result cache
As pointed out by smooth, a transaction's validity may change
over time as the blockchain changes.
2016-04-06 19:01:28 +01:00
moneromooo-monero 1aad759bf1 tx_pool: fix (hopefully) save/load of kept_by_block 2016-04-06 00:11:31 +01:00
moneromooo-monero d662ab5cec rpc: print human readable time since received when printing pool 2016-04-05 20:16:05 +01:00
moneromooo-monero 5c9dd23b1c rpc: add a do_not_relay boolean to tx submission
Just to make it easier
2016-04-05 20:15:54 +01:00
moneromooo-monero d817aeca80 tx_pool: ensure no txes that fail check_inputs get in the block template 2016-04-05 13:06:29 +01:00
moneromooo-monero b1aaf20e57 epee: flush output after a message
This is equivalent to line buffering, as C++ seems to lack
a setvbuf equivalent which alows line buffering.
2016-04-02 20:59:24 +01:00
moneromooo-monero 5092e45e3f tests: unbound API is only accessible in static builds 2016-04-02 16:02:18 +01:00
moneromooo-monero 1a58d202b2 simplewallet: optional address in --generate-from-json
When present, it can be used to validate the keys, as well
as deduce the spend key, if it is absent (watch wallet).
2016-04-02 15:22:59 +01:00
moneromooo-monero 087373eccf Fix potential race with parallel processing of txes/signatures/blocks 2016-04-02 14:20:51 +01:00
moneromooo-monero 48d0747d00 wallet: better output selection for transfer/transfer_new
This now requests the set of outputs that can be mixed first,
to avoid trying non dust but unmixable outputs, which we know
will fail.
2016-04-02 14:17:02 +01:00
moneromooo-monero 113cdc10a2 core: keep the acc loop for the genesis block
For unknown reasons, it was generated with a block reward
consisting of a single large dusty output.
2016-04-02 11:17:49 +01:00
moneromooo-monero daac1cc259 core: remove the block reward accumulation loop
This can generate non decomposed outputs for very large block
rewards (or not so large ones if a miner decides to not quantize
the block rewards). Out of an abundance of caution, we refuse
to generate those. They are still accepted by the consensus code,
however.
2016-04-01 21:42:19 +01:00
moneromooo-monero 34957fcbb9 tests: add test for needed OpenSSL algorithms in unbound
These can be compiled out of libunbound, leading to failure
to check DNSSEC validity.
2016-03-29 17:56:42 +01:00
moneromooo-monero 587e2e9418 README: mention TORSOCKS_ALLOW_INBOUND for wallet connections 2016-03-29 17:55:00 +01:00
moneromooo-monero ead6956080 simplewallet: always gracefully exit on EOF 2016-03-29 17:52:45 +01:00
moneromooo-monero ef4ff4252a connection_basic: avoid gratuitous exception
The remote endpoint is usually invalid, so use a version of the
call that returns an error code instead.
2016-03-28 18:59:09 +01:00
moneromooo-monero 878ab5d896 wallet: fix --generate-from-keys saving as watch only 2016-03-28 16:46:37 +01:00
moneromooo-monero b4eada907c wallet: make load_keys check types when loading JSON 2016-03-27 23:39:34 +01:00
moneromooo-monero 3e557254c7 wallet: make the JSON reading type safe 2016-03-27 23:39:17 +01:00
moneromooo-monero f8d05f3cd9 common: new json_util.h
With code to help factor out reading typed fields from JSON
2016-03-27 23:35:32 +01:00
moneromooo-monero 43962f4103 abstract_tcp_server2: possible fix for exception in handle_accept 2016-03-27 12:53:20 +01:00
moneromooo-monero 24b3e9007a Convey tx verification failure reasons to the RPC client
This allows appropriate action to be taken, like displaying
the reason to the user.

Do just that in simplewallet, which should help a lot in
determining why users fail to send.

Also make it so a tx which is accepted but not relayed is
seen as a success rather than a failure.
2016-03-27 12:37:18 +01:00
moneromooo-monero 77d1c6b672 simplewallet: default to trusted daemon for loopback address 2016-03-27 11:00:15 +01:00
moneromooo-monero d5d46e6d6d tests: obligatory hardfork unit build fix after interface change 2016-03-26 23:44:04 +00:00
moneromooo-monero 25672d3f10 wallet: pass std::function by const ref, not value
Because we can.
2016-03-26 23:32:45 +00:00
moneromooo-monero 0be6e08dd0 wallet: do not leak owned amounts to the daemon unless --trusted-daemon
This will be slower, though more private.

New trusted_daemon parameter to the matching RPC call, false by default.
2016-03-26 23:29:29 +00:00
moneromooo-monero 12146daeed wallet: change sweep_dust to sweep_unmixable
With the change in mixin rules for v2, the "annoying" outputs are
slightly changed. There is high correlation between dust and
unmixable, but no equivalence.
2016-03-26 21:15:47 +00:00
moneromooo-monero 600a3cf0c0 New RPC and daemon command to get output histogram
This is a list of existing output amounts along with the number
of outputs of that amount in the blockchain.

The daemon command takes:
- no parameters: all outputs with at least 3 instances
- one parameter: all outputs with at least that many instances
- two parameters: all outputs within that many instances

The default starts at 3 to avoid massive spamming of all dust
outputs in the blockchain, and is the current minimum mixin
requirement.

An optional vector of amounts may be passed, to request
histogram only for those outputs.
2016-03-26 21:10:43 +00:00
moneromooo-monero f9a2fd2ff5 wallet: handle rare case where fee adjustment can bump to the next kB
It resulted in a tx being sent with too low a fee, and thus rejected.
2016-03-26 11:51:58 +00:00
moneromooo-monero f26651ab8a wallet: factor fee calculation 2016-03-26 11:44:43 +00:00
moneromooo-monero b8527668ff blockchain: for v3, require miner tx to have well behaved outs
This was meant to go in v2, but the miner tx slipped through
the cracks as it doesn't go through the main tx verification
since it doesn't get added to the pool.
2016-03-25 15:11:53 +00:00
moneromooo-monero 97638b1fb7 core: fix miner tx block reward with fees 2016-03-25 15:11:45 +00:00
moneromooo-monero a2e378b91b wallet: add a --generate-from-json flag
It takes a filename containing JSON data to generate a wallet.
The following fields are valid:

  version: integer, should be 1
  filename: string, path/filename for the newly created wallet
  scan_from_height: 64 bit unsigned integer, optional
  password: string, optional
  viewkey: string, hex representation
  spendkey: string, hex representation
  seed: string, optional, list of words separated by spaces

Either seed or private keys should be given. If using private
keys, the spend key may be omitted (the wallet will not be
able to spend, but will see incoming transactions).

If scan_from_height is given, blocks below this height will not
be checked for transactions as an optimization.
2016-03-25 00:56:11 +00:00
moneromooo-monero cc4b19c32e blockchain: fix partial block reward detection 2016-03-22 15:37:16 +00:00
moneromooo-monero 4b425a397c core_tests: fix compile failure with GCC 4.8.4
Reported and tested by smooth
2016-03-21 20:58:07 +00:00
moneromooo-monero f7301c3563 Revert "Print stack trace upon exceptions"
Ain't nobody got time for link/cmake skullduggery.

This reverts commit fff238ec94.
2016-03-21 10:12:23 +00:00
moneromooo-monero 79117d4275 db_lmdb: include the error codes from lmdb api in error logs 2016-03-20 18:06:04 +00:00
moneromooo-monero 1c3ed4c9da cryptonote_protocol: clarify height wording
It's logging the blockchain height, not the top block height
2016-03-20 12:35:53 +00:00
moneromooo-monero 2b4cab30fc epee: fix potential hang on exit
Also close sockets on failure, just in case
2016-03-20 12:05:55 +00:00
moneromooo-monero d2aa427c78 rpc: fix print_tx in command line mode
It was only filling the input in non rpc mode
2016-03-19 23:58:30 +00:00