Commit graph

1193 commits

Author SHA1 Message Date
Howard Chu
bf22109d16 Win32 import batchsize tweaks
Reduce frequency of resizes: bump minimum increase from 128MB to 512MB
Use a bigger safety margin at small batch sizes
2016-02-14 19:31:52 +00:00
Riccardo Spagni
63e2d4195b
Merge pull request #657
1995923 BlockchainLMDB: Deal with DB exceptions at block level with particularity (warptangent)
c16cc20 BlockchainLMDB: Add sanity check for inconsistent state (warptangent)
9118d0a BlockchainLMDB: Call destructor on allocated txn if setup fails (warptangent)
f5581c3 BlockchainLMDB: Replace remaining txn pointer NULLs with nullptr (warptangent)
2016-02-13 19:54:47 +02:00
Riccardo Spagni
354d478286
Merge pull request #656
9832d18 cmake: Include OpenSSL libraries in static linking (warptangent)
c2f2437 cmake: Remove unused variable (warptangent)
7205210 cmake: Fix unbound config compile settings (warptangent)
3e72d97 cmake: Fix overly broad use of dynamic link settings (warptangent)
2016-02-13 19:51:56 +02:00
Riccardo Spagni
999992a64b
Merge pull request #652
c7e6b77 crypto: only check MONERO_USE_SOFTWARE_AES once (moneromooo-monero)
74aef21 crypto: use software AES based on the MONERO_USE_SOFTWARE_AES env var (moneromooo-monero)
2016-02-13 19:51:30 +02:00
warptangent
1995923559
BlockchainLMDB: Deal with DB exceptions at block level with particularity
Add another DB error exception type to distinguish failed txn setup from
general use of txn.

This keeps the error handling flow the same as before the block-level
txn setup changes that moved control up a layer to BlockchainDB.
2016-02-13 05:12:39 -08:00
warptangent
c16cc204d3
BlockchainLMDB: Add sanity check for inconsistent state
This hasn't been known to occur in block-level txn abort, but throw
exception if it does.
2016-02-13 04:17:37 -08:00
warptangent
9118d0a44c
BlockchainLMDB: Call destructor on allocated txn if setup fails 2016-02-13 04:17:37 -08:00
warptangent
f5581c3536
BlockchainLMDB: Replace remaining txn pointer NULLs with nullptr
For consistency.
2016-02-13 04:17:36 -08:00
warptangent
3e72d97ca7
cmake: Fix overly broad use of dynamic link settings
Remove LINK_SEARCH_START_STATIC and LINK_SEARCH_END_STATIC. This is more
appropriate when the compiler flag -static is used.

This had been causing CMake to omit the linker flags necesssary to
distinguish static and dynamic library linking. CMake had assumed static
linking for the target, causing it to omit explicit static link flags.
That is problematic without the -static compile flag being set.

With a library located in system directories, like libboost_date_time,
the full static path (.a), though found correctly by CMake, was treated
by the linker as a dynamic library. This is because
target_link_libraries() transforms the full path to -l<libname> if it's
in a system directory.  Without -static or explicit linker flags, the
dynamic library (.so) is linked.

Removing the above two properties removes the assumption of static. So
-Wl;-Bstatic is inserted where needed. This causes -l<libname> to
properly refer to the static library instead of dynamic.
2016-02-12 14:49:43 -08:00
moneromooo-monero
c7e6b77395
crypto: only check MONERO_USE_SOFTWARE_AES once 2016-02-09 09:38:17 +00:00
moneromooo-monero
74aef213fe
crypto: use software AES based on the MONERO_USE_SOFTWARE_AES env var
Setting to no or 0 also works. If set, any other value enables it.

Useful for running with valgrind in cases where it fails at
properly implementing AES-NI.
2016-02-09 09:30:34 +00:00
moneromooo-monero
759383c52d
hardfork: add a default fork entry for v1 if none exist
To avoid special cases
2016-02-08 20:58:06 +00:00
moneromooo-monero
c7f82ec769
blockchain: initialize m_hardfork to NULL
It can now be set by some other code, and is thus tested
2016-02-08 20:57:20 +00:00
moneromooo-monero
8649b9f1ef
blockchain_db: pass hard fork object as a simple pointer 2016-02-08 20:56:31 +00:00
moneromooo-monero
a333c42cde
core_tests: add tests for hard fork behaviors (MRL-0004)
We also replace the --fakechain option with an optional structure
containing details about configuration for the core/blockchain,
for test purposes. This seems more future friendly.
2016-02-08 18:52:00 +00:00
moneromooo-monero
9ef57946a0
blockchain_utilities: remove unused num_blocks variable 2016-02-08 18:26:03 +00:00
moneromooo-monero
6c8e5c3459
blockchain: reset hardfork object when resetting blockchain
Not doing so will prevent the new genesis block from being
reset if a switch past v1 had occured already.
2016-02-08 18:22:03 +00:00
warptangent
e298b14a55
Blockchain: Update comments on removing block 2016-02-08 09:28:25 -08:00
warptangent
b368e29f67
blockchain_import: Get hard fork version from HardFork
Replace temporary assignment that used hardcoded values.
2016-02-08 09:28:21 -08:00
warptangent
e02577f594
Move HardFork DB update to BlockchainDB::add_block()
Ensures the database is consistent.

Also simplifes blockchain_import in that verify mode off has less to
work around.
2016-02-08 09:28:19 -08:00
warptangent
3800875406
Make HardFork object available to BlockchainDB and derived DB implementations
This will later allow the HardFork object's DB update functions to be
called when the DB transaction that persists across block add/remove is
open.
2016-02-08 09:28:17 -08:00
warptangent
fd46c96dce
BlockchainDB/LMDB: Refactor block-scope DB txn handling for add block
Move block-scope txn start and stop from BlockchainLMDB to BlockchainDB.
2016-02-08 09:28:15 -08:00
warptangent
f3a6000094
BlockchainDB/LMDB/BDB: Extract DB txn functions for block add/remove 2016-02-08 09:28:14 -08:00
warptangent
f47d5b0fe3
BlockchainLMDB: Allow two HardFork functions to update DB during block add
Note that this doesn't yet cause them to be called during block add.
2016-02-08 09:28:12 -08:00
warptangent
15ee0bef4b
BlockchainLMDB: extract txn macros used during block add/remove 2016-02-08 09:28:10 -08:00
warptangent
9d62c161a3
blockchain_import: Add hard fork data for each block when verify mode is off 2016-02-08 08:50:59 -08:00
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