Commit graph

1280 commits

Author SHA1 Message Date
Howard Chu
01c1512f22 More for 92dd4ec6d6
Make sure we stop the right txn too
2016-03-15 13:35:23 +00:00
Mike C
5dd91f6332 fix formatting error on bitmonero print_block return
Example of current return for `print_block 912345`:

    timestamp: 1452793716
    previous hash:
b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78
    nonce: 1646
    is orphan: 0
    height: 912345
    depth: 85434
    hash:
e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6difficul
ty: 815625611
    reward: 7388968946286
    {
      "major_version": 1,
      "minor_version": 2,
      …

Without `std::endl`, the difficulty gets smashed on the end of the hash.
2016-03-14 23:31:09 -06:00
Mike C
ee71946cdc Fix typo on bitmonerod rpc method error. 2016-03-14 23:09:21 -06:00
Riccardo Spagni
240a50f3fb
Merge pull request #723
2abdb2c avoid some val copies (Howard Chu)
2016-03-14 22:20:42 +02:00
Howard Chu
92dd4ec6d6 Hack for read/write txn mixup
save the thread ID of the writer thread so we don't try to use
the writetxn from reader threads
2016-03-14 20:19:46 +00:00
Howard Chu
2abdb2c9fd avoid some val copies 2016-03-14 09:40:49 +00:00
Riccardo Spagni
8689014eda
switch default utilities DB to lmdb, update checkpoints.dat 2016-03-12 21:09:44 +02:00
Riccardo Spagni
dd3cd9e7b8
Merge pull request #718
41ea91a simplewallet: fix hang when setting auto-refresh to 0 (moneromooo-monero)
2016-03-12 16:25:35 +02:00
Riccardo Spagni
853f80e23a
Merge pull request #717
28bfc90 simplewallet: special ^C handling for windows (moneromooo-monero)
2016-03-12 16:21:53 +02:00
moneromooo-monero
41ea91a97a
simplewallet: fix hang when setting auto-refresh to 0
It would try to join the auto refresh thread, which would
only happen after it was done, which would take a long time
when doing so on a newly created wallet.
2016-03-12 14:21:34 +00:00
Riccardo Spagni
b66d455536
Merge pull request #716
789e275 rpc: do not return bans if they're effectively spent (moneromooo-monero)
474e4c0 p2p: lock access to the blocked ips map (moneromooo-monero)
2016-03-12 16:21:20 +02:00
Riccardo Spagni
bb7b31d5ed
Merge pull request #715
8bc1bd6 wallet: use minimum mixin when RPC asks for too low mixin (moneromooo-monero)
31d2e0f wallet_rpc_server: make use_fork_rules public (moneromooo-monero)
2016-03-12 16:14:07 +02:00
moneromooo-monero
28bfc903b9
simplewallet: special ^C handling for windows
Because obviously it doesn't work as other POSIX platforms.

Reported and tested by luigi1111.
2016-03-12 14:05:25 +00:00
moneromooo-monero
789e2755f7
rpc: do not return bans if they're effectively spent
The blocked ip list will still hold them till next time
a connection attempt is made with that IP, so the effective
length of the ban may be negative.
2016-03-12 13:49:08 +00:00
moneromooo-monero
474e4c00f0
p2p: lock access to the blocked ips map 2016-03-12 13:48:58 +00:00
moneromooo-monero
8bc1bd6b65
wallet: use minimum mixin when RPC asks for too low mixin
After the fork, normal transfer functions called via RPC
use the minimum mixin 2 if 0 or 1 is requested. While the
incoming transaction may be valid (eg, it has an unmixable
and at most a mixable input), it is a simple way to make
sure RPC users can't get a seemingly random accept/reject
behavior if they don't update their requested mixin.
2016-03-11 21:32:16 +00: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
Riccardo Spagni
0a4dd68c17 minor tweaks, add readme for crypto_ops_builder 2016-03-11 22:48:46 +02:00
Riccardo Spagni
dfd0e9c97d
Merge pull request #712
66c2fc7 Need to link boost::chrono in more places now (Howard Chu)
b937a2c Use boost::thread instead of std::thread (Howard Chu)
2016-03-11 20:15:10 +02:00
Howard Chu
66c2fc7b70 Need to link boost::chrono in more places now 2016-03-11 16:17:08 +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
Howard Chu
8941ce0398 More for bdec7cb
More uses of db error helper
2016-03-09 18:24:16 +00:00
Riccardo Spagni
b96147030c
Merge pull request #705
f7ed167 blockchain_utilities: Update documentation (warptangent)
2016-03-05 23:14:06 +02:00
Riccardo Spagni
d0f011d873
Merge pull request #704
e2b7e55 get_payments short ID (luigi1111)
2016-03-05 23:13:23 +02:00
Riccardo Spagni
93605eb05f
Merge pull request #702
0485d17 blockchain_export: Support BerkeleyDB (warptangent)
41487e3 blockchain_export: Move DB implementation includes (warptangent)
2016-03-05 23:12:05 +02:00
warptangent
f7ed167fc0
blockchain_utilities: Update documentation 2016-03-05 13:11:44 -08:00
Riccardo Spagni
32dc08d19a
Merge pull request #700
bdec7cb BlockchainLMDB: Use DB error helper consistently (warptangent)
c5932eb BlockchainLMDB: Add DB error to exception (warptangent)
a49c355 Blockchain: Omit verbose time stats messages by default (warptangent)
2016-03-05 23:10:38 +02:00
Riccardo Spagni
c3af15702f
Merge pull request #698
ee7a8b8 Get rid of lmdb_cur (Howard Chu)
2016-03-05 23:06:26 +02:00
Riccardo Spagni
14c1e214ad
Merge pull request #696
d57ec75 Fix language (Howard Chu)
2016-03-05 23:06:04 +02:00
luigi1111
e2b7e55be6 get_payments short ID
Add support for short/integrated/encrypted IDs to get_payments RPC
2016-03-05 13:30:48 -06:00
warptangent
0485d17274
blockchain_export: Support BerkeleyDB
TEST:

blockchain_export -h

This should show "berkeley" as an available option to --database.

With an existing BerkeleyDB database, run:

blockchain_export --database berkeley
2016-03-05 06:46:11 -08:00
warptangent
41487e32be
blockchain_export: Move DB implementation includes 2016-03-05 06:46:09 -08:00
warptangent
bdec7cbfb3
BlockchainLMDB: Use DB error helper consistently 2016-03-03 21:27:13 -08:00
warptangent
c5932eb5ea BlockchainLMDB: Add DB error to exception 2016-03-03 20:15:37 -08:00
warptangent
a49c355cae
Blockchain: Omit verbose time stats messages by default
This is already the default for the daemon, but by checking a command
line argument and calling a Blockchain member function setter.

Initialize the variable to false so it's not dependent on an external
command-line argument check. This allows utilities like
blockchain_import to have a reasonable default without code changes.
2016-03-03 20:14:48 -08:00
Howard Chu
ee7a8b87f9 Get rid of lmdb_cur
We don't need it now with per-txn cursors.
2016-03-03 19:06:27 +00:00
Howard Chu
d57ec7595c Fix language 2016-03-03 00:34:19 +00:00
Howard Chu
f5affbef26 More for df239428c0
Let ARMv7 work again
2016-03-03 00:13:13 +00:00
warptangent
2c823c1589
Make partial revert consistent
If user-defined comparator is used, subdb shouldn't be opened with
MDB_INTEGERKEY.

TODO: Again, this will be added back with future schema updates.
2016-03-01 02:47:16 -08:00
warptangent
df239428c0
Revert part of 7db89ed2ee
For now, so existing databases work.

TODO: add these back with future schema updates.
2016-02-29 18:03:41 -08:00
warptangent
c9c4060dc6
BlockchainLMDB: Add height and db error to exception 2016-02-29 17:52:54 -08:00
Riccardo Spagni
bf09285443
Merge pull request #688
c2a1fee simplewallet: prompt for private keys when generating wallets (moneromooo-monero)
4513b4c simplewallet: add a new --restore-from-keys option (moneromooo-monero)
2016-02-29 17:30:29 -05:00
Riccardo Spagni
c3c4e28061
Merge pull request #687
5e3557d move g_test_dbg_lock_sleep from a global to a function level static (moneromooo-monero)
2016-02-29 17:30:10 -05:00
Riccardo Spagni
d60bf4ee36
Merge pull request #686
7db89ed ARMv7: fix unaligned accesses (Howard Chu)
5a07cef Wrap some more actions in a larger read txn (Howard Chu)
8cc7a36 read txn/cursor stuff (Howard Chu)
86a7f2b core: check whether an update is needed straight away (moneromooo-monero)
ea5fa5e core: print "update needed" hard fork notifications in red (moneromooo-monero)
2016-02-29 17:29:26 -05:00
moneromooo-monero
c2a1fee428
simplewallet: prompt for private keys when generating wallets
instead of supplying them on the command line. It's more
unwieldy, but better protects against information leaks.
2016-02-27 11:53:11 +00:00
Howard Chu
7db89ed2ee ARMv7: fix unaligned accesses
And cleanup some key comparators
2016-02-25 13:57:00 +00:00
Howard Chu
5a07cefe7b Wrap some more actions in a larger read txn 2016-02-23 20:47:15 +00:00
Howard Chu
8cc7a36f0b read txn/cursor stuff
Could wrap more later.
2016-02-23 20:47:15 +00:00
moneromooo-monero
86a7f2b1e7 core: check whether an update is needed straight away 2016-02-23 20:29:17 +00:00
moneromooo-monero
ea5fa5e9b6 core: print "update needed" hard fork notifications in red 2016-02-23 20:29:17 +00:00
moneromooo-monero
283894d8ff
dns_utils: const compatibility with older libunbound
https://www.nlnetlabs.nl/bugs-script/show_bug.cgi?id=515
2016-02-23 19:02:05 +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
moneromooo-monero
5e3557d2c3
move g_test_dbg_lock_sleep from a global to a function level static
This avoids the need to define that variable in every program
which uses epee.
2016-02-22 19:34:09 +00:00
moneromooo-monero
0eb4d054f6
db_bdb: add missing include for std::condition_variable 2016-02-20 15:38:43 +00:00
Riccardo Spagni
81a93cd171
Merge pull request #680
360f72f simplewallet: wording change for single tx confirmation (moneromooo-monero)
2016-02-20 17:11:31 +02:00
Riccardo Spagni
c3baa82ac8
Merge pull request #678
11d555c Fix crash in std::map for connections_map (Howard Chu)
014f886 std::condvar is broken on Win32 with gcc/g++ 4.8 too (Howard Chu)
7c86c59 Use boost::thread instead of std::thread (Howard Chu)
2016-02-20 17:10:51 +02:00
Riccardo Spagni
a903d9c3f6
Merge pull request #677
57e75fa BlockchainBDB: Check if hard fork subdbs need reset (warptangent)
47f6cf8 BlockchainBDB: Support blockchain_import --drop-hard-fork command (warptangent)
2016-02-20 17:09:49 +02:00
moneromooo-monero
360f72fa90
simplewallet: wording change for single tx confirmation 2016-02-20 11:17:28 +00:00
Howard Chu
014f8868f2 std::condvar is broken on Win32 with gcc/g++ 4.8 too
Use boost...
2016-02-18 21:31:21 +00:00
Howard Chu
7c86c5997d Use boost::thread instead of std::thread
std::thread crashes on (at least) ARMv6 g++ 4.8/4.9
2016-02-18 21:30:10 +00:00
warptangent
57e75fa33f
BlockchainBDB: Check if hard fork subdbs need reset
See f7e337e625 for LMDB equivalent.
2016-02-18 06:38:56 -08:00
warptangent
47f6cf8bea
BlockchainBDB: Support blockchain_import --drop-hard-fork command
See c657e772c4 for LMDB equivalent.
2016-02-18 06:37:45 -08:00
warptangent
d258f6e63a
blockchain_import: Pass ARCH_WIDTH macro if 32-bit or not.
This also avoids warnings.
2016-02-18 06:14:35 -08:00
Riccardo Spagni
1889c0e81c
Merge pull request #675
27d4e50 core: check whether an update is needed straight away (moneromooo-monero)
8892173 core: print "update needed" hard fork notifications in red (moneromooo-monero)
2016-02-18 10:01:37 +02:00
Riccardo Spagni
43fe8c4933
Merge pull request #674
05e7ac0 blockchain_import: Check bit width for more than just WIN32 (warptangent)
2016-02-18 10:01:01 +02:00
moneromooo-monero
27d4e50dfa
core: check whether an update is needed straight away 2016-02-17 22:57:38 +00:00
moneromooo-monero
889217381f
core: print "update needed" hard fork notifications in red 2016-02-17 22:57:14 +00:00
Howard Chu
9218cad640 Fix cffc411c90
Don't include bdb header unless defined(BERKELEY_DB)
2016-02-17 20:41:34 +00:00
warptangent
05e7ac0360
blockchain_import: Check bit width for more than just WIN32
Pass the CMake bit width setting to compile flags for blockchain_import
and blockchain_converter.

For LMDB on 32-bit, hyc has found that batch size of 100 appears to be a
good default.
2016-02-17 12:37:15 -08:00
Howard Chu
02abe3590d Use MDB_PREV_MULTIPLE
in get_global_output_indices
2016-02-17 16:14:50 +00:00
Howard Chu
7a4755d3a4 Fixup after lmdb master resync 2016-02-17 16:14:38 +00:00
Riccardo Spagni
c069814773
Merge pull request #672
3b13a74 Shutup about VERSION 0 (Howard Chu)
1537477 Use cursor in get_output_key (Howard Chu)
f2faf8c Use MDB_APPEND mode where possible (Howard Chu)
090b548 Use cursors in write txns (Howard Chu)
ed08d21 Keep a running blocksize count (Howard Chu)
0fc9334 Win32 import batchsize tweaks (Howard Chu)
2016-02-17 17:10:07 +02:00
Riccardo Spagni
6636b0a6da
Merge pull request #671
8f09b71 wallet: clear missing data on rescan_bc (moneromooo-monero)
2016-02-17 17:09:48 +02:00
Riccardo Spagni
3225a7d28d
Merge pull request #666
27f76e2 blockchain_import: Build string for db type list (warptangent)
1aa8a9d blockchain_import: Add mode argument representing multiple DB flags (warptangent)
cffc411 blockchain_import: Support BerkeleyDB (warptangent)
19c1aaa blockchain_import: Add database type argument (warptangent)
0fedce0 blockchain_import: Make LMDB-specific names general (warptangent)
2016-02-17 17:09:21 +02:00
Howard Chu
3b13a7473e Shutup about VERSION 0 2016-02-17 05:06:19 +00:00
Howard Chu
1537477c9f Use cursor in get_output_key 2016-02-17 04:05:29 +00:00
Howard Chu
f2faf8cdd9 Use MDB_APPEND mode where possible
When keys are contiguous and monotonically increasing, this gets
denser page utilization (doesn't leave padding in page splits).
Can't be used for keys that are inserted in random order (e.g. hashes)
In total this only saves around 1.5% of space compared to original
DB code. The previous patch accounted for 0.8% savings on its own;
the blocks tables just aren't that big.
2016-02-17 04:05:29 +00:00
Howard Chu
090b548c3b Use cursors in write txns
Saves a bit of seek overhead. LMDB frees them automatically
in txn_(commit|abort) so they need no cleanup.
2016-02-17 04:05:29 +00:00
Howard Chu
ed08d2152e Keep a running blocksize count
Used in batch size estimation, avoids rereading already processed
blocks during import
2016-02-17 04:05:28 +00:00
Howard Chu
0fc93345ea 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-17 04:05:28 +00:00
moneromooo-monero
8f09b71b9b
wallet: clear missing data on rescan_bc 2016-02-15 20:51:30 +00:00
warptangent
27f76e2ee4
blockchain_import: Build string for db type list 2016-02-14 16:25:35 -08:00
warptangent
1aa8a9d26f
blockchain_import: Add mode argument representing multiple DB flags
These modes match those optionally provided as part of the daemon's
--db-type argument.

Argument after the # is interpreted as a composite mode if there's only
one (no comma separated arguments).

Sample usage:

blockchain_import --database lmdb#fastest

blockchain_import --database berkeley#fastest

Multiple specific DB flags are still supported, e.g.

blockchain_import --database lmdb#nosync,nordahead

blockchain_import --database berkeley#txn_nosync
2016-02-14 16:25:35 -08:00
Howard Chu
d8f9bb380c Keep a running blocksize count
Used in batch size estimation, avoids rereading already processed
blocks during import
2016-02-15 00:22:09 +00:00
warptangent
cffc411c90
blockchain_import: Support BerkeleyDB 2016-02-14 16:02:38 -08:00
warptangent
19c1aaa9f6
blockchain_import: Add database type argument
Default to LMDB.
2016-02-14 16:02:37 -08:00
warptangent
0fedce00d5
blockchain_import: Make LMDB-specific names general
Also update terms to better distinguish blockchain management/engine
from database type.
2016-02-14 16:02:37 -08:00
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