Commit graph

206 commits

Author SHA1 Message Date
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
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
Riccardo Spagni
09f62ed33e
Merge pull request #1225
04da979 Always confirm transfers defaults to ON/YES (NanoAkron)
2016-10-22 22:16:39 +02:00
Riccardo Spagni
f800390ccc
Merge pull request #1224
8231997 simplewallet: fix sweep_all misreporting sweeped amount for rct outputs (moneromooo-monero)
985f61a wallet: force 0 mixin transactions to use pre-rct txes (moneromooo-monero)
2016-10-22 22:15:50 +02:00
Riccardo Spagni
b53c9e5549
Merge pull request #1200
a3748f4 Rewrote add_wallet_create_if_needed for clearer flow and behaviour (NanoAkron)
2016-10-22 22:07:38 +02:00
NanoAkron
a3748f40ea
Rewrote add_wallet_create_if_needed for clearer flow and behaviour 2016-10-15 22:29:28 +01:00
NanoAkron
04da979f46
Always confirm transfers defaults to ON/YES 2016-10-15 20:38:07 +01:00
moneromooo-monero
8231997b66
simplewallet: fix sweep_all misreporting sweeped amount for rct outputs
RingCT outputs will be 0 in the vin, so we need to get the actual
amount from elsewhere.
2016-10-15 19:18:52 +01:00
moneromooo-monero
4e6d70808d
wallet: better implementation of sweep_unmixable
This was still using the old transaction creation algorithm,
coupled with a deterministic output selection scheme, which
made it ill suited to the job, since it'd loop indefinitely
in case the fee increased between the test tx and adding the
fee.
2016-10-04 17:44:56 +01:00
Riccardo Spagni
2723cd12e1
Merge pull request #1173
65ea836 wallet2_api: added Wallet::daemonBlockChainTargetHeight() libwallet_api: Wallet::blockChainTargetHeight (Jacob Brydolf)
2016-10-04 12:15:02 +02:00
Riccardo Spagni
bfdac4b5ff
Merge pull request #1160
80b4da3 wallet: wallet option to confirm transfers with no payment id (moneromooo-monero)
2016-10-04 12:11:32 +02:00
Riccardo Spagni
2ef81914b5
Merge pull request #1140
bba6af9 wallet: cold wallet transaction signing (moneromooo-monero)
9872dcb wallet: fix log confusion between bytes and kilobytes (moneromooo-monero)
d9b0bf9 cryptonote_core: make extra field removal more generic (moneromooo-monero)
98f19d4 serialization: add support for serializing std::pair and std::list (moneromooo-monero)
2016-10-04 11:27:38 +02:00
Jacob Brydolf
65ea8364f8 wallet2_api: added Wallet::daemonBlockChainTargetHeight()
libwallet_api: Wallet::blockChainTargetHeight

Signed-off-by: Jacob Brydolf <jacob@brydolf.net>
2016-10-03 20:47:41 +02:00
moneromooo-monero
80b4da3330
wallet: wallet option to confirm transfers with no payment id
set confirm-missing-payment-id 0|1

Defaults to true.
2016-10-01 17:03:53 +01:00
moneromooo-monero
bba6af9064
wallet: cold wallet transaction signing
This change adds the ability to create a new unsigned transaction
from a watch only wallet, and save it to a file. This file can
then be moved to another computer/VM where a cold wallet may load
it, sign it, and save it. That cold wallet does not need to have
a blockchain nor daemon. The signed transaction file can then be
moved back to the watch only wallet, which can load it and send
it to the daemon.

Two new simplewallet commands to use it:
sign_transfer (on the cold wallet)
submit_transfer (on the watch only wallet)

The transfer command used on a watch only wallet now writes an
unsigned transaction set in a file called 'unsigned_monero_tx'
instead of submitting the tx to the daemon as a normal wallet does.
The signed tx file is called 'signed_monero_tx'.
2016-09-27 07:46:39 +01:00
Ilya Kitaev
7b4a85b309 wallet2_api: added Wallet::daemonBlockChainHeight() 2016-09-26 23:19:25 +03:00
moneromooo-monero
9c7b0cb28e
wallet: change priority/fee to ArticMine's recommendation
We keep 1, 2, 3 multipliers till the fee decrase from 0.01/kB
to 0.002/kB, where we start using 1, 20, 166 multipliers.
This ensures the higher multiplier will compensate for the
block reward penalty when pushing past 100% of the past median.

The fee-multiplier wallet setting is now rename to priority,
since it keeps its [0..3] range, but maps to different multiplier
values.
2016-09-16 11:50:52 +01:00
moneromooo-monero
cd01bae735
Decrease minimum fee from 0.01/kB to 0.002/kB
The wallet will start using that fee about two weeks after hard
fork 3, when most people will likely have updated their daemons.
2016-09-15 09:28:33 +01:00
moneromooo-monero
b951bc8780
wallet: transfer_selected_rct now also selects fake outs 2016-08-28 21:30:34 +01:00
moneromooo-monero
c3b3260ae5
New "Halfway RingCT" outputs for coinbase transactions
When RingCT is enabled, outputs from coinbase transactions
are created as a single output, and stored as RingCT output,
with a fake mask. Their amount is not hidden on the blockchain
itself, but they are then able to be used as fake inputs in
a RingCT ring. Since the output amounts are hidden, their
"dustiness" is not an obstacle anymore to mixing, and this
makes the coinbase transactions a lot smaller, as well as
helping the TXO set to grow more slowly.

Also add a new "Null" type of rct signature, which decreases
the size required when no signatures are to be stored, as
in a coinbase tx.
2016-08-28 21:30:26 +01:00
moneromooo-monero
d4b62a1e29
rct amount key modified as per luigi1111's recommendations
This allows the key to be not the same for two outputs sent to
the same address (eg, if you pay yourself, and also get change
back). Also remove the key amounts lists and return parameters
since we don't actually generate random ones, so we don't need
to save them as we can recalculate them when needed if we have
the correct keys.
2016-08-28 21:30:19 +01:00
moneromooo-monero
a47ceee83b
wallet: do not store signatures in the wallet cache
Saves some substantial space.
Also avoid calculating tx hashes we don't need.
2016-08-28 21:30:10 +01:00
moneromooo-monero
2c9d9519f1
wallet2: factor m_spent changes
Makes it easier to track what is going on.
2016-08-28 21:30:04 +01:00
moneromooo-monero
230fca2d56
wallet: use the prefered rct case only when enough rct outs exist 2016-08-28 21:29:55 +01:00
moneromooo-monero
c27194a444
wallet: do not try to use rct txes a few blocks before the fork 2016-08-28 21:29:53 +01:00
moneromooo-monero
9b70856ccb
rct: make the amount key derivable by a third party with the tx key
Scheme design from luigi1114.
2016-08-28 21:29:46 +01:00
moneromooo-monero
3cb2edec66
rpc: send global indices along with blocks/transacions on refresh
This plugs a privacy leak, where the wallet tells the daemon
which transactions contain outputs for the wallet by asking
for additional information for that particular transaction.

As a nice bonus, this actually makes refresh slightly faster.
2016-08-28 21:29:38 +01:00
moneromooo-monero
84c82cd775
wallet: better tx input selection
We try to avoid related inputs, when possible
2016-08-28 21:29:32 +01:00
moneromooo-monero
e81a2b2cfa
port get_tx_key/check_tx_key to rct 2016-08-28 21:29:24 +01:00
moneromooo-monero
37c895e5e3
wallet: rct specific output selection
Before the normal selection, we attempt to find either one or two
suitable outputs to use as inputs to the rct tx. The intent is that
most rct txes will have one or two inputs, and we want all to look
the same if possible.
When two outputs are needed, we try to find a pair which are not
related (ie, by being from the same or similar block height).
2016-08-28 21:29:11 +01:00
moneromooo-monero
1017a75460
wallet: factor transfer_rct code with transfer code
The "transfer" simplewallet command is renamed to "transfer_original".
"transfer_new" is renamed "transfer", "transfer_rct" is removed,
and the new "transfer" now selects rct or non rct transactions
based on the current block height.
2016-08-28 21:29:05 +01:00
moneromooo-monero
089df4af83
wallet: reset output spent status on blockchain reorg
If the blockchain gets reorganized, all outputs spent in the part
of the blockchain that's blown away need to be reset to unspent
(they may end up spent again on the blocks that replace the blocks
that are removed, however).
2016-08-28 21:28:47 +01:00
moneromooo-monero
dc4aad7eb5
add rct to the protocol
It is not yet constrained to a fork, so don't use on the real network
or you'll be orphaned or rejected.
2016-08-28 21:28:37 +01:00
moneromooo-monero
11dc091464
Fake outs set is now decided by the wallet
This plugs a privacy leak from the wallet to the daemon,
as the daemon could previously see what input is included
as a transaction input, which the daemon hadn't previously
supplied. Now, the wallet requests a particular set of
outputs, including the real one.

This can result in transactions that can't be accepted if
the wallet happens to select too many outputs with non standard
unlock times. The daemon could know this and select another
output, but the wallet is blind to it. It's currently very
unlikely since I don't think anything uses non default
unlock times. The wallet requests more outputs than necessary
so it can use spares if any of the returns outputs are still
locked. If there are not enough spares to reach the desired
mixin, the transaction will fail.
2016-08-11 14:35:27 +01:00
moneromooo-monero
1593553e03
new unlocked parameter to output_histogram
This constrains the number of instances of any amount
to the unlocked ones (as defined by the default unlock time
setting: outputs with non default unlock time are not
considered, so may be counted as unlocked even if they are
not actually unlocked).
2016-08-01 22:16:00 +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
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
Riccardo Spagni
fc3e135b83
Merge pull request #902
014f3a0 Add a daemon RPC version, and make simplewallet check it (moneromooo-monero)
2016-07-20 13:55:59 +02: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
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
Riccardo Spagni
3923cbddaf
Merge pull request #878
945c272 wallet: add a fee multiplier (moneromooo-monero)
2016-07-06 18:14:34 +02: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
Ilya Kitaev
eec0f57d60 Typo fixed 2016-06-22 14:37:53 +03:00
Ilya Kitaev
2facbe77e4 Wallet API : WalletManager::findWallets() added 2016-06-03 14:52:58 +03:00
Ilya Kitaev
bc4584c1ff Merge remote-tracking branch 'upstream/master' 2016-05-27 11:33:08 +03:00
Ilya Kitaev
ff52c67aa9 i_wallet_callback: virtual dtor 2016-05-13 12:59:29 +03:00
Ilya Kitaev
2d799097ca Merge remote-tracking branch 'upstream/master' 2016-05-12 15:14:30 +03:00
Howard Chu
cebb97c913 Move refresh height to keys file from cache file 2016-04-29 15:33:28 +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
Riccardo Spagni
714dcc2866
Merge pull request #815
b0850a9 wallet: add a new sweep_all command and RPC command (moneromooo-monero)
2016-04-26 18:08:09 +02:00
Riccardo Spagni
7098ad6804
Merge pull request #814
68cbe15 	modified:   src/wallet/wallet2.cpp 	modified:   src/wallet/wallet2.h (awfulcrawler)
4b325bd 	modified:   src/simplewallet/simplewallet.cpp 	modified:   src/wallet/wallet2.cpp 	modified:   src/wallet/wallet2.h (awfulcrawler)
2016-04-26 18:04:00 +02:00
Riccardo Spagni
0922ae2b43
Merge pull request #811
672162d tests: fix compile failure on wallet2::transfer (moneromooo-monero)
b0c18ef wallet2: move output selection api public (moneromooo-monero)
2016-04-26 18:02:26 +02:00
Ilya Kitaev
dce5374660 Merge remote-tracking branch 'upstream/master' into develop 2016-04-26 11:08:40 +03: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
awfulcrawler
68cbe1579e modified: src/wallet/wallet2.cpp
modified:   src/wallet/wallet2.h

Removed working comments
2016-04-18 20:20:31 +12:00
awfulcrawler
4b325bdb66 modified: src/simplewallet/simplewallet.cpp
modified:   src/wallet/wallet2.cpp
	modified:   src/wallet/wallet2.h

Update to fix unconfirmed balance and give a slightly more verbose and informative confirmation message for transfers
2016-04-18 14:57:47 +12:00
Howard Chu
b7140daea2 Add GET_HASHES_FAST rpc, use it in wallet
When m_refresh_from_block_height has been set, only hashes will be
retrieved up to that height, instead of full blocks. The same will
be done for "refresh <height>" when the specified height is beyond
the current local blockchain.
2016-04-17 15:25:46 +01:00
moneromooo-monero
b0c18ef9cd
wallet2: move output selection api public 2016-04-17 11:20:44 +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
Ilya Kitaev
df6026182a Merge remote-tracking branch 'upstream/master' 2016-03-31 12:01:19 +03:00
moneromooo-monero
b4eada907c
wallet: make load_keys check types when loading JSON 2016-03-27 23:39:34 +01: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
Ilya Kitaev
8790904cf9 - testnet option added to api; 2016-03-25 17:06:30 +03: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
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
fff238ec94
Print stack trace upon exceptions
Useful for debugging users' logs
2016-03-19 21:48:36 +00:00
Ilya Kitaev
62606f11f5 Wallet::store_to(path, password) implemented; 2016-03-16 14:29:06 +03:00
Ilya Kitaev
5a4f099540 Wallet::setPassword() method for wallet2_api 2016-03-16 14:29:06 +03:00
moneromooo-monero
31d2e0f84d
wallet_rpc_server: make use_fork_rules public
We will need it in the wallet RPC server
2016-03-11 21:31:50 +00:00
Howard Chu
b937a2c915 Use boost::thread instead of std::thread
and all other associated IPC
2016-03-11 15:09:50 +00:00
moneromooo-monero
4513b4cd2b
simplewallet: add a new --restore-from-keys option
It is similar in use to --restore-from-view-key, but also expects
a spend private key.

Requested by luigi1112, and useful to restore MyMonero wallets.
2016-02-22 22:10:55 +00:00
Riccardo Spagni
569316aea3
Merge pull request #634
7fc6fa3 wallet: forbid dust altogether in output selection where appropriate (moneromooo-monero)
5e1a739 blockchain: log number of outputs available for a new tx (moneromooo-monero)
2016-01-31 15:21:45 +02:00
moneromooo-monero
7fc6fa3fa2
wallet: forbid dust altogether in output selection where appropriate 2016-01-31 11:03:09 +00:00
moneromooo-monero
b11539fda7
wallet: detect and handle failed outgoing transfers
When a transaction is not found in the pool anymore, it is marked
as failed, and displayed as such in show_transfers.
2016-01-29 19:44:48 +00:00
moneromooo-monero
3b1d7e03fc
Fix V1/V2 use of hard fork related parameters
Some of it uses hardcoded height, which will need some thinking
for next (voted upon) fork.
2016-01-29 17:21:11 +00:00
moneromooo-monero
67bbb56a6c
wallet2: decide at runtime which upper tx size to use
The value will be different depending on whether we've reached
the first hard fork, which allows a larger size, or not.

This fixes transactions being rejected by the daemon on mainnet
where the first hard fork is not yet active.
2016-01-10 11:56:13 +00:00
Riccardo Spagni
de03926850
updated copyright year 2015-12-31 08:39:56 +02:00
moneromooo-monero
bc8a52efd8
wallet: add a rescan_bc command and rescan_blockchain RPC
Blockchain hashes and key images are flushed, and blocks are
pulled anew from the daemon.
The console command is shortened to match bc_height.
This should make it a lot easier on users who are currently
told to remove this particular cache file but keep the keys
one, etc, etc.
2015-12-30 15:06:03 +00:00
moneromooo-monero
92ef6b54fe
wallet: protect against exceptions in the block pull thread
This can happen when the daemon exits, which would also cause
the wallet to crash via unhandled exception
2015-12-30 12:43:15 +00:00
Riccardo Spagni
c41f785d56
Merge pull request #550
8c93608 wallet: fix load/save versioning bug for recently added tx data (moneromooo-monero)
2015-12-22 10:27:44 +02:00
moneromooo-monero
8c93608f2f
wallet: fix load/save versioning bug for recently added tx data
The version number passed to those data's serialize function
was always 0, not the wallet's version as I had expected.
A version number now exists for these structures so they're
versioned correctly.
2015-12-20 14:03:15 +00:00
moneromooo-monero
8ea7af1ba3
Allow the wallet to access hard fork information
And make it change behavior slightly when close/after first hard fork
2015-12-19 14:52:30 +00:00
moneromooo-monero
c6cfe0f26d
wallet: make the wallet refresh type a wallet setting
instead of a command line setting. It makes sense that is is
a long lived setting.
2015-12-05 21:44:25 +00:00
Riccardo Spagni
bc1bc4adb2
Merge pull request #507
62e49a5 wallet: optional automatic refresh from the daemon (moneromooo-monero)
2015-11-30 00:19:47 +02:00
moneromooo-monero
62e49a5f02
wallet: optional automatic refresh from the daemon
The daemon will be polled every 90 seconds for new blocks.
It is enabled by default, and can be turned on/off with
set auto-refresh 1 and set auto-refresh 0 in the wallet.
2015-11-28 12:41:06 +00:00
moneromooo-monero
490590306e
wallet2: parallelize pulling blocks and processing them on refresh
This needed locking the use of m_http_client, to avoid collisions
in I/O.
2015-11-27 17:25:15 +00:00
moneromooo-monero
d0eaf1d4e1
wallet2: maintain the short chain manually when refreshing 2015-11-27 00:35:41 +00:00
moneromooo-monero
a4e9506069
wallet2: split pull blocks between pulling and processing 2015-11-27 00:03:43 +00:00
moneromooo-monero
9b945f5211
wallet: make the refresh optimizations selectable via command line
Take the opportunity to add a no-coinbase case too, for even faster
sync when an address is known to never have mined to.
2015-11-22 19:03:10 +00:00
moneromooo-monero
d2c031332e
wallet: speedup refresh from daemon
Assume the whole of a coinbase goes to the same address (so that
if the first output isn't for us, none of it is), and only look
for payment id when we received something in the transaction.
2015-11-22 18:07:19 +00:00
moneromooo-monero
55a2da7475
wallet2: speedup refresh a bit
Use the NoodleDoodle threading technique to speedup a couple
code blocks on the main path when refreshing blocks without
any transactions for us.
2015-11-22 18:07:07 +00:00
moneromooo-monero
db1fb66e66
wallet: storing outgoing tx info now defaults to enabled
The info is stored encrypted, and is pretty useful, often after
the fact.
2015-11-22 12:40:03 +00:00
moneromooo-monero
9156ba3a3c
wallet: rename store-tx-keys to store-tx-info
With backward compatibility
2015-11-22 12:26:27 +00:00
moneromooo-monero
b3d4d41e29
wallet: improve show_transfers
More information is now saved and displayed
2015-11-22 12:13:59 +00:00
moneromooo-monero
725ae4e710
wallet: use incoming blocks to keep track of payments too 2015-11-21 23:22:15 +00:00
moneromooo-monero
3f611bc3dc
wallet: track outgoing payments and add a show_transfers command
It's a user friendly display of incoming and outgoing transfers,
listed by height, within an optional height range.
2015-11-15 21:59:40 +00:00
moneromooo-monero
c7dc6ef8e8
simplewallet: add a set default-mixin command
The default default mixin is 4. It can now be changed per wallet.
2015-10-30 21:16:51 +00:00