Commit Graph
100 Commits
Author SHA1 Message Date
moneromooo-monero 9b00d80f85 wallet2: pass by const ref where possible
Reported by kenshi84
2016-12-10 11:43:44 +00:00
moneromooo-monero f4a3ce15c1 Fix sending outputs from a tx with more than one pubkey
A bug in cold signing caused a spurious pubkey to be included
in transactions, so we need to ensure we use the correct one
when sending outputs from one of those.
2016-12-09 18:21:21 +00:00
moneromooo-monero dfbb85b6fe blockchain: fix setting non trovial alternate chain as invalid
The wrong iterator was being used.
Also preincrement iterators to avoid possibly invalidating them,
I'm not sure this is necessary, but let's be safe.
2016-12-08 22:26:27 +00:00
moneromooo-monero 0b91d82574 simplewallet: restore automatically setting trusted local daemon 2016-12-08 20:01:24 +00:00
moneromooo-monero 3b00527500 ringct: add sc_check calls in MLSAG_Ver for ss and cc
luigi1111's recommendation
2016-12-07 22:41:21 +00:00
moneromooo-monero 2f1732a7e5 ringct: guard against bad data exceptions in worker threads
If purported pubkeys aren't actually valid pubkeys, exceptions
will fly. These will terminate if thrown in a worker thread.
Guard against this.
2016-12-07 22:09:43 +00:00
moneromooo-monero 6c44f5c6eb wallet: send 0 change to a random address where necessary with rct
If a rct transaction would cause no change to be generated, a zero
change output is added, and sent to a randomly generated address.
This ensures that no transaction will be sent with just one output,
which could cause the receiver to be able to determine which of the
inputs in the sent rings is the real one.
This is very rare, since it requires the sum of outputs to be equal
to the sum of outputs plus the fee, which is now a function of the
last few blocks.
2016-12-07 21:05:50 +00:00
moneromooo-monero 73ac3b8e26 wallet2: avoid possible undefined behavior on empty string 2016-12-04 14:56:06 +00:00
moneromooo-monero 3f7d6fb57d Fix delayed exit when syncing 2016-12-04 12:27:45 +00:00
moneromooo-monero 7c0dd5e46c net_node: drop connections from banned IPs after looping through connections
This keeps the connections lock just for the time of looping
and adding connectoins to a list, and the dropping happens
after it. This should avoid lengthy delays waiting for the
connections lock.
2016-12-03 11:20:48 +00:00
moneromooo-monero 59443bf9df ringct: fix MGs serialization to JSON 2016-12-02 13:16:19 +00:00
moneromooo-monero 4adde0423b p2p: possibly fix crash in relay_blocks 2016-12-01 23:52:16 +00:00
moneromooo-monero 204b1bff62 blockchain: use high bound block reward on error where appropriate
If the block reward to use for the fee calculation can't be
calculated (should not happen in practice), use a high bound,
so we use a fee overestimate that will be accepted by the network.
2016-12-01 16:34:09 +00:00
moneromooo-monero 0e18f46522 db_lmdb: add info in an error message when we can't get an output
Will be useful to debug
2016-12-01 14:31:40 +00:00
moneromooo-monero c96f9b0255 db_lmdb: guard against going out of sync on unexpected db results
m_num_outputs keeps track of the number of outputs, which should
be the same as the size of both the output_txs and output_amounts
databases. If one goes out of sync, we need to throw to abort
whatever it is we were doing.
2016-12-01 14:29:35 +00:00
moneromooo-monero bef51e677e db_lmdb: minor pedantic tweaks
Add consts in a few places where it makes sense, avoid unnecessary
memory reallocation where we know the full size needed at the outset,
simplify and avoid memory copy.
2016-12-01 14:28:09 +00:00
moneromooo-monero 3465c4ebc7 db_lmdb: set same packing format for output_data_t and pre_rct_output_data_t
For safety, though it seems to have been the case already.

Also add a comment about the necessary layout identity.
2016-12-01 14:26:18 +00:00
moneromooo-monero fcd178ef33 wallet_api: add a few daemon related getters
Blockchain height, version, Mining hash rate...
2016-11-29 10:54:38 +00:00
moneromooo-monero 8f6ec90c83 blockchain: reject invalid pubkeys from v4 2016-11-28 22:32:58 +00:00
moneromooo-monero 5783dd8c99 tests: add unit tests for uri parsing 2016-11-28 17:54:28 +00:00
moneromooo-monero 82ba2108e9 wallet: add API and RPC to create/parse monero: URIs 2016-11-28 17:54:22 +00:00
moneromooo-monero d9001b43ac epee: add functions to convert from URL format (ie, %XX values) 2016-11-28 17:54:16 +00:00
moneromooo-monero 8b0e04cb12 monero.supp: add a suppression for noisy boost cond var signalling 2016-11-28 09:52:59 +00:00
moneromooo-monero c3527dafd5 epee: signal cond var before unlocking
This is more canonical, and avoids some helgrind spam
2016-11-28 09:52:49 +00:00
moneromooo-monero 657a70e004 wallet: add a getter for the filename path 2016-11-26 14:19:57 +00:00
moneromooo-monero d6086f5b4e Improve daemon RPC version handling
Daemon RPC version is now composed of a major and minor number,
so that incompatible changes bump the major version, while
compatible changes can still bump the minor version without
causing clients to unnecessarily complain.
2016-11-26 12:56:44 +00:00
moneromooo-monero 17b6bd6d35 Fix DNS failures in offline mode preventing daemon startup 2016-11-23 23:14:49 +00:00
moneromooo-monero 6d76072612 simplewallet: remove double confirmation when submitting signed tx 2016-11-23 20:45:03 +00:00
moneromooo-monero 92dea04929 wallet2: fix wrong change being recorded for cold signed txes 2016-11-23 20:27:22 +00:00
moneromooo-monero 1d9e223944 rpc: do not include output indices for pool txes
Those aren't yet in the blockchain, so will not be found
(and aren't yet known, since it depends on where exactly the
tx will be mined in the next block or blocks)
2016-11-23 18:56:54 +00:00
moneromooo-monero e227d6e7ac rpc: bump version after RPC changes 2016-11-22 20:01:20 +00:00
moneromooo-monero 2c0173c722 Add a get_outs (fully text based) version of get_outs.bin 2016-11-22 20:00:40 +00:00
moneromooo-monero e05907b3e7 rpc: add output indices to gettransactions
Someone apparently needs that to make a wallet but never asked.
If you read that and that's not what you wanted, the bugtracker
is at https://github.com/monero-project/monero/issues
2016-11-22 20:00:23 +00:00
moneromooo-monero ab7b56e0e2 tests: fix uninitialized data valgrind reports in levin tests 2016-11-20 17:51:17 +00:00
moneromooo-monero 73e8a76d86 tests: fix uninitialized data valgrind reports in serialization tests 2016-11-20 17:25:21 +00:00
moneromooo-monero 7abfc5474c wallet: fix exporting outputs and key images with txes with two pubkeys
This also needs to make sure to pick the correct one, in the case
where cold signing caused to tx keys to be included.
2016-11-19 09:36:40 +00:00
moneromooo-monero 5fc36f981c wallet2_api: fix history leak on destruction 2016-11-18 21:42:08 +00:00
moneromooo-monero 69b188c4b2 wallet2_api: fix payment ids from integrated addresses being ignored 2016-11-18 19:13:43 +00:00
moneromooo-monero 452aeca5cd epee: blind attempt to fix exit hang on windows
Thanks to duckduckgo and the internet.

This might even compile.
2016-11-17 22:10:03 +00:00
moneromooo-monero d01f5c7f1f wallet2: fix illegal memory access removing newlines from password 2016-11-17 20:43:58 +00:00
moneromooo-monero e6264a2c35 wallet2: fix decrypting a bit too much in authenticated mode 2016-11-17 20:31:00 +00:00
moneromooo-monero 4eb7347fdd wallet: return fee in transfer RPC 2016-11-16 18:56:45 +00:00
moneromooo-monero a0131c8be3 wallet: auto sync outputs and key images in cold signing files
When passing around unsigned and signed transactions, outputs
and key images are passed along (outputs are passed along unsigned
transactions from the hot wallet to the cold wallet, key images
are passed along with signed transations from the cold wallet
to the hot wallet), to allow more user friendly syncing between
hot and cold wallets.
2016-11-16 09:22:24 +00:00
moneromooo-monero f8066116dd wallet2: fill key image and pubkey maps when importing outputs 2016-11-16 09:22:18 +00:00
moneromooo-monero 5fe363cd22 wallet: cast indices to string in logs to be nice to CLANG 2016-11-16 09:22:13 +00:00
moneromooo-monero 11ae1873f8 wallet2: try all tx keys when scanning a new transaction
The vast majority of transactions will have just one tx pubkey,
but a bug with cold wallet signing caused two such keys to be
there, with the second one being the real one.
2016-11-16 09:22:05 +00:00
moneromooo-monero 072d646a45 wallet2: fill in key image map when importing key images 2016-11-15 21:20:08 +00:00
moneromooo-monero 23d80b15fd core: remove any tx pubkey from extra before adding one
This will happen when signing a transaction from a cold wallet,
and we don't want the placeholder the hot wallet put in it.
2016-11-15 21:20:02 +00:00
moneromooo-monero d72376d467 simplewallet: add a verbose flag to incoming_transfers
Prints pubkey and key image as well
2016-11-13 18:20:46 +00:00
moneromooo-monero 47413a5626 simplewallet: spell out change when signing a transfer
Also catch change to multiple addresses, this is unexpected
2016-11-13 17:48:45 +00:00
moneromooo-monero 14cb088300 simplewallet: print public keys too on spendkey/viewkey commands 2016-11-13 17:24:53 +00:00
moneromooo-monero a99ab49dd5 wallet: fix serialization of new m_key_image_known member 2016-11-13 16:38:29 +00:00
moneromooo-monero 18772a3ba9 tests: fix another fee test on 32 bit 2016-11-13 12:21:52 +00:00
moneromooo-monero bd4da18525 simplewallet: include amount sent in transfer confirmation 2016-11-13 12:12:22 +00:00
moneromooo-monero d48f2e9bc6 wallet: fix serialization of new m_key_image_known member 2016-11-13 12:02:29 +00:00
moneromooo-monero 70d4915980 wallet: add version dependency to the wallet target 2016-11-12 12:55:19 +00:00
moneromooo-monero cd929b89b0 levin: fix wrong value passed as return code to remote call
When receiving an answer packet, the command code was passed
to the callback instead of the error code. This was hiding
the "command not found" failure from the peer, and in turn
causing the code to attempt to deserialize a non existent
reply string.
2016-11-12 10:12:23 +00:00
moneromooo-monero 2078cb6f2f tests: fix tests builds after fluffy blocks merge 2016-11-11 18:17:16 +00:00
moneromooo-monero 0e418d2a58 rpc: bump RPC version
I forgot to bump it previously when changing RPC, most notably
for the addition of the unlocked field in the histogram RPC.
This causes new wallets to not realize when they're talking to
an older daemon, and get confused trying to get outputs to use
as fake outs. This otherwise gratuitous bump ensures than old
daemons will be detected by wallets using this code.
2016-11-10 23:00:24 +00:00
moneromooo-monero c27c0feb3d tests: fix fee unit tests on 32 bit 2016-11-10 20:40:06 +00:00
moneromooo-monero 1669621937 wallet2_api: support for sweeping all 2016-11-09 19:32:37 +00:00
moneromooo-monero 63772e4048 wallet: fix corner case of no recent outputs available
Also clarify related logs
2016-11-09 14:01:54 +00:00
moneromooo-monero acf908c834 thread_group: fix build with asserts enabled
See https://github.com/monero-project/monero/pull/1291
2016-11-09 11:29:06 +00:00
moneromooo-monero 5c4cb96cfb cryptonote_protocol: drop connection when find_blockchain_supplement fails
This will be when we can't find common ground between the peer's
short chain history and our blockchain.

This fixes bad peers claiming a higher blockchain height from never
dropped, and keeping the node in synchronizing state forever, since
we will never get blocks from that peer.
2016-11-09 11:04:20 +00:00
moneromooo-monero c441a61ef6 wallet2_api: API to sign and verify a message 2016-11-08 21:21:08 +00:00
moneromooo-monero 40a68e22fa wallet2_api: add API for create_unmixable_sweep_transactions 2016-11-08 20:03:07 +00:00
moneromooo-monero 8aba0d4b4c wallet: encrypt outputs and key images files with the view key
This key is available to both cold and hot wallet.
Authenticated encryption will guard against interception and/or
modification of the file.
2016-11-07 20:01:05 +00:00
moneromooo-monero c80f4d416d wallet: fix output collision detection for view wallets
View wallets do not have the spend secret key, and are thus
unable to derive key images for incoming outputs. Moreover,
a previous patch set key images to zero as a means to mark
an output as having an unknown key image, so they could be
filled in when importing key images at a later time. That
later patch caused spurious collisions. We now use public
keys to detect duplicate outputs. Public keys obtained from
the blockchain are checked to be identical to the ones
derived locally, so can't be spoofed.
2016-11-07 18:59:30 +00:00
moneromooo-monero 63fe6fd9ba wallet2_api: allow connection to return "yes, but wrong version" 2016-11-07 12:00:29 +00:00
moneromooo-monero eb194925ec wallet2_api: do not copy the whole pending tx when iterating 2016-11-06 10:36:08 +00:00
moneromooo-monero 97288a5ce2 wallet2_api: add API for tx notes 2016-11-05 21:19:08 +00:00
moneromooo-monero e59caf87d3 performance_tests: re-enable them...
I think I'm the only one to review things here...
2016-11-04 11:11:45 +00:00
moneromooo-monero b5d6faada3 wallet: fix bad amounts/fees again
m_amount_out was sometimes getting initialized with the sum of
an transaction's outputs, and sometimes with the sum of outputs
that were not change. This caused confusion and bugs. We now
always set it to the sum of outputs. This reverts an earlier
fix for bad amounts as this used the other semantics. The wallet
data should be converted automatically in a percentage of cases
that I'm hesitant to estimate. In any case, restoring from seed
or keys or rebuilding the cache will get it right.
2016-11-02 23:11:30 +00:00
moneromooo-monero 7edf76f92a CONTRIBUTING: add something about testing and bug reporting 2016-11-01 10:18:51 +00:00
moneromooo-monero 18f66f44ef wallet: use the dynamic per kB fee 2016-10-31 08:38:06 +00:00
moneromooo-monero e6deb8abda rpc: add a dynamic fee estimation RPC call 2016-10-31 08:38:00 +00:00
moneromooo-monero 82dbba10d4 core: dynamic fee algorithm from ArticMine
The fee will vary based on the base reward and the current
block size limit:

fee = (R/R0) * (M0/M) * F0

R: base reward
R0: reference base reward (10 monero)
M: block size limit
M0: minimum block size limit (60000)
F0: 0.002 monero

Starts applying at v4
2016-10-31 08:37:08 +00:00
moneromooo-monero f5ccfa4001 core: fix removal of extra nonce using wrong type 2016-10-30 20:44:45 +00:00
moneromooo-monero 3c2cad2d46 Revert "remove cn_deserialize"
This is useful (to me).

This reverts commit f968ccb9d3.
2016-10-30 20:34:48 +00:00
moneromooo-monero bb560dd814 wallet: new import_outputs/export_outputs commands
The intended use is to export outputs from a hot wallet, which
can scan incoming transfers from the network, and import them
in the cold wallet, which can't. The cold wallet can then compute
key images for those outputs, which can then be exported with
export_key_images, etc.
2016-10-30 19:37:09 +00:00
moneromooo-monero 7e6d3cf441 wallet: set incoming outputs' key image to 0 on view wallets
This allows rescan_spent to know the daemon response to those
is not valid.
2016-10-30 12:14:33 +00:00
moneromooo-monero 1f9e6a46d8 wallet: print tx overview on submit_transfer too
This is on the potentially compromised wallet, but still guards
against stupid mistakes.
2016-10-30 10:49:22 +00:00
moneromooo-monero 4bfb81a7f5 simplewallet: remove destinations with zero amount in sign_transfer
This will happen when sending to another address, after removing
the fee.
2016-10-30 09:15:04 +00:00
moneromooo-monero 48b57d813c monero.supp: valgrind suppressions file
Seeded with a spurious problem when inspecting stack trace
2016-10-29 13:34:24 +01:00
moneromooo-monero ffd8c41f36 ringct: check the size of amount_keys is the same as destinations 2016-10-29 13:33:48 +01:00
moneromooo-monero 836669d276 ringct: always shutdown the boost io service
Even if no worker threads were started, it needs shutting down
or it will cause an invalid access in the io service thread
2016-10-29 13:31:53 +01:00
moneromooo-monero 56b07f7b89 tests: add performance test for keypair::generate 2016-10-26 22:10:05 +01:00
moneromooo-monero 069d688cf7 simplewallet: log transactions to submit in submit_transfer
Not as trustworthy as this is in the view wallet, the one
that's considered compromised.
2016-10-26 13:17:29 +01:00
moneromooo-monero 31abac4daf wallet: fix pre-rct cold wallet signing not splitting change
Re-creating the transaction on the cold wallet was not splitting
the change, causing the transaction to be rejected by the network.
This worked on testnet since amounts do not have to be split.

Also add selected_transfers, which can now be saved since they're
size_t rather than iterators. This allows the view wallet to
properly set the sent outputs as spent and update balance.

Bump transfer file version numbers to match.
2016-10-25 21:44:31 +01:00
moneromooo-monero eb4ecd442d daemon: fix min/max tracking using the wrong size
Reported by iDunk
2016-10-23 23:18:34 +01:00
moneromooo-monero 30946700a3 daemon: even when switching branches, compile the damn thing ffs 2016-10-23 20:21:00 +01:00
moneromooo-monero 2f4f6c7c26 daemon: do not divide by 0 when the pool is empty 2016-10-23 20:05:13 +01:00
moneromooo-monero ff8825210d simplewallet: factor locked_transfer, and fix a few rough edges
Factor locked_transfer into transfer_main, which brings various
improvements for free (multiple addresses, proper detection of
multiple payment ids, obeying the prompt settings).

Also fix a few things, such as using uint64_t instead of int
for block heights, actually checking whether getting blockchain
height succeeded, etc.
2016-10-23 18:21:30 +01:00
moneromooo-monero 839280d5fc daemon: add a print_pool_stats daemon command
Helps see what's going on now that Monero is getting used
2016-10-23 16:11:20 +01:00
moneromooo-monero 59f0d4b574 ringct: some more small optimizations 2016-10-23 16:10:17 +01:00
moneromooo-monero 10a79eae24 daemon: report transaction relay status in print_pool* commands 2016-10-23 00:32:55 +01:00
moneromooo-monero 1e163666f3 core: notify the txpool when transactions are relayed 2016-10-23 00:32:49 +01:00
moneromooo-monero f3c374fe08 tx_pool: set relayed flag on relay 2016-10-22 20:46:19 +01:00
moneromooo-monero 372f338682 wallet: sanity check on selected transfer indices in signed ptx 2016-10-22 18:07:26 +01:00
moneromooo-monero 12d861694d perf_timer: format string fix for 32 bits 2016-10-20 18:43:33 +01:00