Commit graph

1167 commits

Author SHA1 Message Date
warptangent 7006b2ebe1
blockchain_utilities: Have fake_core create HardFork object
The HardFork object is needed for the importer to update the hard fork
data when verify mode is off.
2016-02-08 08:50:53 -08:00
warptangent 8f863e742d
Blockchain: Optionally pass in HardFork object 2016-02-08 08:50:51 -08:00
warptangent f7e337e625
fake_core: Check if hard fork subdbs need reset at start 2016-02-08 08:50:48 -08:00
warptangent c657e772c4
blockchain_import: Add --drop-hard-fork command 2016-02-08 08:50:47 -08:00
warptangent 412243901d
blockchain_import: Add exception to log output 2016-02-08 08:50:27 -08:00
Riccardo Spagni 1cfe0bdbef
Merge pull request #648
f6abc53 simplewallet: check watch-only view key matches standard address (moneromooo-monero)
2016-02-08 18:34:40 +02:00
Riccardo Spagni 0c4222158f
Merge pull request #646
c7b96b9 wallet: check a key image isn't already present when adding one (moneromooo-monero)
2016-02-08 18:34:13 +02:00
Riccardo Spagni a1a5b810bc
Merge pull request #645
d9f4b39 daemon: remove leftover debug log (moneromooo-monero)
2016-02-08 18:33:30 +02:00
Riccardo Spagni de78962e1c
Merge pull request #643
05bfb51 core: move the db lock to the data directory (moneromooo-monero)
2016-02-08 18:32:08 +02:00
Riccardo Spagni cea6f6fb9c
Merge pull request #641
7658ac0 blockchain: revert handle_get_objects adding block id on tx not found (moneromooo-monero)
3a0f4d8 berkeleydb: fix delete/free mismatch (moneromooo-monero)
1642be2 minor bugfixes and refactoring (Thomas Winget)
098dcf2 unit_tests: fix mnemonics unit test testing invalid seeds (moneromooo-monero)
2016-02-08 18:31:42 +02:00
moneromooo-monero f6abc5324f
simplewallet: check watch-only view key matches standard address 2016-02-05 22:41:45 +00:00
moneromooo-monero d9f4b395e8
daemon: remove leftover debug log 2016-02-05 16:36:28 +00:00
moneromooo-monero c7b96b91ed
wallet: check a key image isn't already present when adding one
If it is, it points to reuse of a tx key, which isn't meant to happen.
If it does, a key image collision means that only one of those
outputs is spendable, so the wallet selects the larger amount,
unless that output was spent already.

This causes a discrepancy betewen reported received inputs and
payment total.

Since tx keys are 256 bits, this should never happen except if
done on purpose, or if a sender uses a bad PRNG.
2016-02-05 16:24:23 +00:00
moneromooo-monero 05bfb51d3e
core: move the db lock to the data directory
Locking just one db turns out to not have been a good idea, since
the pool and p2p state fdles have to be used anyway.

Also ensure the directory exists before tring to lock.
2016-02-04 18:09:45 +00:00
moneromooo-monero 7658ac0f45
blockchain: revert handle_get_objects adding block id on tx not found
This differs from the original CN code, and there seems to be
no reason to include the block itself, if it was found
2016-02-03 21:08:03 +00:00
moneromooo-monero 3a0f4d8a57
berkeleydb: fix delete/free mismatch
Despite being C++, the stats object is allocated by the underlying
C layer using malloc(3).
2016-02-03 08:49:11 +00:00
Thomas Winget 1642be242d minor bugfixes and refactoring
- Blockchain should store if it's running on testnet or not

- moved loading compiled-in block hashes to its own function for clarity

- on handle_get_objects, should now correctly return false if a block's
transactions are missing

- replace instances of BOOST_FOREACH with C++11 for loops in Blockchain.
2016-02-02 18:58:39 +00:00
moneromooo-monero 64a2aa3376
hardfork: allow passing chain height in get(height) for convenience 2016-02-01 20:06:55 +00:00
Riccardo Spagni 616df496e9 Revert "Merge pull request #632"
This reverts commit 58f890652e, reversing
changes made to 39d73d2a27.
2016-01-31 15:49:11 +02:00
Riccardo Spagni f780f2e7ba
Merge pull request #635
8b3539b core: prevent the database from being used by multiple daemons (moneromooo-monero)
2016-01-31 15:22:14 +02: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
Riccardo Spagni 8d976a0683
Merge pull request #633
80882ac wallet: guard against exception in process_blocks (moneromooo-monero)
2016-01-31 15:21:13 +02:00
Riccardo Spagni 58f890652e
Merge pull request #632
2cf8b32 wallet: guard against exception in process_blocks (moneromooo-monero)
2016-01-31 15:20:47 +02:00
Riccardo Spagni 39d73d2a27
Merge pull request #631
bcac101 daemon: fix a few issues reported by valgrind (moneromooo-monero)
a7e8174 tx_pool: fix serialization of new relayed data (moneromooo-monero)
601ad76 hardfork: fix mixup in indexing variable in get_voting_info (moneromooo-monero)
444e22f blockchain: remove unused timer (moneromooo-monero)
7edfdd8 blockchain: fix m_sync_counter uninitialized variable use (moneromooo-monero)
d97582c epee: use generate_random_bytes for new random uuids (moneromooo-monero)
17c7c9c epee: remove dodgy random code that nobody uses (moneromooo-monero)
2016-01-31 15:20:18 +02:00
moneromooo-monero 8b3539bc11
core: prevent the database from being used by multiple daemons
A boost lock is used to determine whether more than one process
wants to access the database. The boost file_lock doesn't seem
to like locking directories, so we use an arbitrary file in it.
This allows to still run two daemons if they have different
database directories (ie, LMDB/BDB, different data directories).
2016-01-31 12:58:08 +00:00
moneromooo-monero 7fc6fa3fa2
wallet: forbid dust altogether in output selection where appropriate 2016-01-31 11:03:09 +00:00
moneromooo-monero 5e1a7391e8
blockchain: log number of outputs available for a new tx 2016-01-31 10:59:58 +00:00
moneromooo-monero 80882ac6dd
wallet: guard against exception in process_blocks
If an exception occurs, the thread needs to be joined, or it
will be deleted while still live, and terminate the process.
2016-01-30 23:52:43 +00:00
moneromooo-monero 2cf8b32229
wallet: guard against exception in process_blocks
If an exception occurs, the thread needs to be joined, or it
will be deleted while still live, and terminate the process.
2016-01-30 23:34:23 +00:00
moneromooo-monero bcac1018af
daemon: fix a few issues reported by valgrind
In particular, ensure we check the status of RPC response structures,
as some functions will return success, but with a BUSY status, when
the daemon is not yet synced, and the response will not filled.
2016-01-30 22:14:51 +00:00
moneromooo-monero a7e817482c
tx_pool: fix serialization of new relayed data 2016-01-30 22:14:09 +00:00
moneromooo-monero 601ad76a5e
hardfork: fix mixup in indexing variable in get_voting_info 2016-01-30 22:13:20 +00:00
moneromooo-monero 444e22f01a
blockchain: remove unused timer 2016-01-30 19:02:33 +00:00
moneromooo-monero 7edfdd8f24
blockchain: fix m_sync_counter uninitialized variable use
It counts the number of blocks added since last zeroing
2016-01-30 19:01:43 +00:00
moneromooo-monero bf6d1474c0
new flush_txpool command, and associated RPC call
It can flush a particular tx, or the whole pool (the RPC command
can flush a list of transactions too)
2016-01-30 13:28:26 +00:00
moneromooo-monero 6288295f8e
rpc: add missing return on error when getting a tx 2016-01-30 13:28:12 +00:00
moneromooo-monero b7e37b7763
simplewallet: show_transfers can now show just failed txes 2016-01-30 13:26:57 +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 4b23714658
tx_pool: serialize missing kept_by_block flag 2016-01-29 19:44:25 +00:00
Riccardo Spagni b91fc2dc3c
Merge pull request #629
94b98fb tx_pool: do not accept txes not in a block if they timed out before (moneromooo-monero)
eadbdf3 tx_pool: fix use of invalidated iterator (moneromooo-monero)
3b1d7e0 Fix V1/V2 use of hard fork related parameters (moneromooo-monero)
2016-01-29 19:24:24 +02:00
moneromooo-monero 94b98fb5fa
tx_pool: do not accept txes not in a block if they timed out before
This is intended to avoid cases where a timed out tx will be
re-relayed by another peer for which it has not timed out yet,
which would cause the tx to stay in the network's pool for a
long time (until all peers time it out before another one
tries to relay it again).
2016-01-29 17:21:25 +00:00
moneromooo-monero eadbdf354a
tx_pool: fix use of invalidated iterator 2016-01-29 17:21:20 +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
warptangent b8cc6d46bd
BlockchainBDB: Continue when tx has no outputs
See 24b66243c2
2016-01-28 21:15:46 -08:00
warptangent b8707466e2
BlockchainBDB: When removing, find amount output index fast by starting at end
This improves blockchain reorganization time by allowing one of the more
expensive DB lookups when popping a block to not have to seek through a
long dup list in the "output_amounts" db. This is most noticeable for
HDDs.

See ffcf6bdb95
2016-01-28 21:15:44 -08:00
warptangent 1a5c3fa729
BlockchainBDB: Remove tx outputs in reverse order
Data should be removed in the reverse order it was added.

This matches the order of removal in
blockchain_storage::pop_transaction_from_global_index.

See f11def012f
2016-01-28 21:15:42 -08:00
Riccardo Spagni afe2d1a09f
add received time to print_pool and print_pool_sh 2016-01-28 11:24:26 +02:00
Riccardo Spagni 153fe0cb75
Merge pull request #622
e514f0a even more typos (Henning Kopp)
9abc4b8 more typos fixed (Henning Kopp)
0693f3c fixed typo (Henning Kopp)
2016-01-25 19:39:07 +02:00
Riccardo Spagni 56570ee2b5
Merge pull request #621
f76f656 simplewallet: remove leftover command line refresh-type handling (moneromooo-monero)
2016-01-25 19:38:35 +02:00
Riccardo Spagni 96d0c0373e
Merge pull request #620
15d9ac8 wallet2: update spent comparison now that we have two spent states (moneromooo-monero)
2016-01-25 19:38:14 +02:00
Henning Kopp e514f0a369 even more typos 2016-01-25 15:05:29 +01:00
Henning Kopp 9abc4b831b more typos fixed 2016-01-25 13:42:44 +01:00
Henning Kopp 0693f3c7e6 fixed typo 2016-01-25 13:36:14 +01:00
moneromooo-monero f76f656d55
simplewallet: remove leftover command line refresh-type handling 2016-01-25 08:29:49 +00:00
moneromooo-monero 15d9ac8abd
wallet2: update spent comparison now that we have two spent states 2016-01-24 19:55:18 +00:00
me0wmix 28f95eb001 OpenBSD support for Monero. 2016-01-21 11:18:26 -07:00
warptangent 24b66243c2
db_lmdb: Continue when tx has no outputs 2016-01-19 16:55:31 -08:00
Howard Chu 30f92f5630 Fix hf when import with verify off
Delete the hf tables, so the next open will rescan and regenerate
2016-01-15 17:26:19 +00:00
Riccardo Spagni b9c7ba180d
added checkpoints 2016-01-15 15:22:31 +02:00
Riccardo Spagni a583a96d82
bumped version to 0.9.1 for point release 2016-01-15 15:03:43 +02:00
Riccardo Spagni 15e0cbd01e
Merge pull request #610
945ac78 hardfork: fix accepting v2 blocks too early (moneromooo-monero)
2016-01-15 15:02:26 +02:00
moneromooo-monero 945ac788d4
hardfork: fix accepting v2 blocks too early 2016-01-15 11:54:35 +00:00
binaryFate 0100e951d3 'max limit of...' is redundant wording, rephrase 2016-01-14 23:13:12 +01:00
binaryFate 80e38895b3 Print msg when successfully updating out_peers 2016-01-14 23:10:07 +01:00
Riccardo Spagni 92b753d5e4
Merge pull request #606
8ce12a9 Fix arm asm (Howard Chu)
94de39f Tweak arm6 flags (Howard Chu)
2016-01-12 14:44:46 +02:00
Riccardo Spagni d31d424726
Merge pull request #603
c5baf30 use load_file_to_string and exit with error on file read errors (Fabian Hirschmann)
7b2d27f remove new lines at the end of the password only (Fabian Hirschmann)
302cc9c add --password-file option (Fabian Hirschmann)
2016-01-12 14:43:38 +02:00
Howard Chu 8ce12a978e Fix arm asm
About 10% faster than plain C mul128 on raspi1B
2016-01-11 23:16:02 +00:00
moneromooo-monero 664dc42e18
rpc: fix missing target information in RPC call
which fixes the status command via RPC too.

Turns out there are two versions of the GET_INFO call.
I'd never noticed before.
2016-01-11 22:52:01 +00:00
moneromooo-monero eaf4dcd747
daemon: fix status command when run from command line 2016-01-11 21:50:41 +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
Fabian Hirschmann c5baf30208 use load_file_to_string and exit with error on file read errors 2016-01-09 19:11:34 +01:00
Fabian Hirschmann 7b2d27f89a remove new lines at the end of the password only 2016-01-09 18:59:39 +01:00
Fabian Hirschmann 302cc9c700 add --password-file option 2016-01-09 02:49:41 +01:00
moneromooo-monero a44d94d390
rpc: is_key_image_spent now checks the tx pool too 2016-01-05 22:16:24 +00:00
Riccardo Spagni 58dbc9d122
fixed conflicts 2016-01-03 20:02:44 +02:00
Howard Chu da0bce3472 Use CMAKE_LINKER, not hardcoded "ld" 2016-01-03 08:22:38 +00:00
moneromooo-monero 7f8e5ced47
daemon: fix ban length using wrong parameter 2016-01-02 16:30:12 +00:00
Riccardo Spagni 5c71f5d13e
update version 2015-12-31 23:12:13 +02:00
Riccardo Spagni b98d88c17e
Merge pull request #587
1e07110 Nicer looking exit when blockchain.bin is found (moneromooo-monero)
2015-12-31 22:34:57 +02:00
moneromooo-monero 1e07110a7a
Nicer looking exit when blockchain.bin is found
Do not print the exception message, and write the important bit
in red, since people will only read the last line otherwise.
2015-12-31 17:09:00 +00:00
moneromooo-monero 40f97ce83d
core: do not use the persistent pool state for tests
Fixes intermittent test failures when the pool contains
unexpected transactions that were brought in from the
live pool.
2015-12-31 14:24:06 +00:00
Riccardo Spagni ac7d27d4f9
Merge pull request #584
5c67c48 wallet: don't forget to close the file after storing cache (moneromooo-monero)
2015-12-31 12:43:15 +02:00
moneromooo-monero 5c67c486e8
wallet: don't forget to close the file after storing cache
Also add some flags to open, as epee's save_string_to_file does,
to truncate file, etc.
2015-12-31 10:34:17 +00:00
Riccardo Spagni de03926850
updated copyright year 2015-12-31 08:39:56 +02:00
Riccardo Spagni 810a11267c
fixed copyrights with bad year references 2015-12-31 08:37:27 +02:00
moneromooo-monero 576effe11a
blockchain: kill ioservice on scope end, rather than manually
This ensures this will be done without fail, as the error prone
matching of every return with a call to KILL_IOSERVICE leads to
hard to debug corruption when one is missing.
2015-12-30 16:08:30 +00:00
moneromooo-monero ed5d017c0f
miner: minor fixes on stop
- only try to stop if actually started
- print number of threads before zeroing it

This fixes the suspiciously doubled "Mining has been stopped"
message on exit.
2015-12-30 16:06:32 +00: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
moneromooo-monero af2106122d
net_peerlist: move a couple functions from public to private
They do not take the object lock, and are meant to be used only
internally, called from a function which does take the lock.
2015-12-30 11:37:49 +00:00
Riccardo Spagni 32a26332f8
no longer need to pass the size to rapidjson 2015-12-30 12:25:29 +02:00
Riccardo Spagni 9e45eadb98
Merge pull request #575
61befc2 wallet: store cache to file without unnecessary memory buffer (moneromooo-monero)
2015-12-30 09:40:33 +02:00
Riccardo Spagni b6d41cdac1
Merge pull request #574
61ce8d6 wallet_rpc_server: exit async, so we reply to stop_wallet RPC (moneromooo-monero)
9847db6 wallet: do not return error if incoming_transfers finds none (moneromooo-monero)
2015-12-30 09:40:04 +02:00
Riccardo Spagni ddc6d45f96
Merge pull request #573
0953355 blockchain_db: inform user about new format if blockchain.bin is found (moneromooo-monero)
2015-12-30 09:39:27 +02:00
Riccardo Spagni fd36eea6dd
Merge pull request #572
b39aae7 Tweak 45800a25e9 (hyc)
4a5a5ff blockchain: always stop the ioservice before returning (moneromooo-monero)
78b65cf db_lmdb: safety close db at exit (moneromooo-monero)
45800a2 db_lmdb: fix a strdup/delete[] mistmatch (moneromooo-monero)
2015-12-30 09:38:41 +02:00
Riccardo Spagni aa6dd048d8
Merge pull request #570
fc34132 Remove assert from status command (hyc)
2015-12-30 09:37:25 +02:00
Riccardo Spagni 9b3300fe9b
Merge pull request #569
ee9d71e BlockchainDB: skip fixup check if read-only database (warptangent)
2015-12-30 09:36:54 +02:00
Riccardo Spagni a7e56870fe
Merge pull request #568
b0541a5 blockchain: remove obsolete containers (moneromooo-monero)
18a5211 blockchain: Fix height in call to on_blockchain_dec (moneromooo-monero)
2015-12-30 09:36:18 +02:00
moneromooo-monero 61befc2293
wallet: store cache to file without unnecessary memory buffer 2015-12-29 15:46:37 +00:00
hyc b39aae7aa5 Tweak 45800a25e9
trivial cleanup
2015-12-29 00:11:35 +00:00